Thanks for reporting the error and sorry for the inconvenience! I'll get on this later today but if you're interested in the technical details:
It seems like two neighboring water tiles notified the mod to transition the tile into water at the same time. There was an object (LuaEntity) on the tile which collides with water so it had to be killed/destroyed. The first instance would've gone without a hitch, but when the second notification happened it tried to kill an already dead object, which is why the error calls the entity "invalid".
Your validity check suggestion is indeed correct, but I want to look at the root cause as well. Maybe I can prevent the code being ran twice in the first place.
Anyway, thanks again for reporting and glad you enjoy the mod!