Attach a SAVE GAME (.aoe2spgame) or GAME RECORDING (.aoe2record) of the match where you encountered the issue. Link it below if using an external file service.
This bug is present since the original game. If too many ships (or land units) are too close each others and you move them, sometimes some land units goes on water and are stuck, or ships goes on the land and are stuck too.
Often this is only one unit per bug. It’s really rare but it’s possible.
(One example of this bug is the cyan castle in Tamerlane mission 2 “Gurkhan of Persia”, if you put units in the “water cyan castle”, when you release them they are stuck on “water”)