From a bug report, a hero hiding on the
ceiling while poly'd into a piercer or lurker-above could be moved long
distances when a monster attacked his location, because when the attacker
moves into hero's spot, hero's new location is chosen before the attacker
had released its own spot. If things are crowded, the nearest open space
can be quite far away, including beyond nonpassable walls. Fix by taking
attacker off the map before choosing hero's destination, so in crowded
conditions they will likely end up trading places.
This also prevents eels and sharks from moving onto land when the
hero has hidden on the ceiling next to their pool. They'll miss without
moving into hero's spot, but the hero will become unhidden so they'll be
able to make ordinary water-to-shore attack on their next turn.
Lastly, when the attacker is a long worm, the spot chosen for hero
might be filled by its tail by the time hero actually moves. So double
check and possibly re-select target spot after moving a worm's tail.