Custom submit handler is also called when deleting a node
You made the mistake of giving the form submit function a name that matches the patter form-name_submit. So it does not only trigger by your submit button. It is triggered by every submit button in the form.

Rename your function and you should be good.