This is SE's fault, and I can't fix from my end.
Whenever they make a new spaceship, they are running entity.clone() on every entity.
However, to delete the old spaceship, they use entity.destroy()
Earendel must instead use entity.delete{raise_destroy=true}
This change will allow my code to properly handle the deletion.
Feel free to modify SE's code manually. I also recommend creating a bug report in the SE git or discord.