Thanks for sharing these details. However, I'm still unable to reproduce the problem. I have tried to replicate your setting as close as possible, but for me the error message only appears if either
(a) The slot has several appointments, and I tick the box "Delete this appointment" on all of these, or
(b) The slot has one appointment, and I tick the box "Delete this appointment" on it.
This is however intended - if a slot starts in the past, it should not become empty.
I'm also unsure how the code change you made influences the problem - I don't think that piece of code is used at the relevant point. The test that leads to the error message you mentioned is actually in slotforms.php, around line 310.