Sometimes my Trade Wagons, when they are close together (say 3 of them moving on a route at once) if they path at the shoreline they glitch out onto the water. Also they can sometimes get through walls? atleast in one particular case at one of my settlements.
The Trade wagon displays as a 3x3 tiles, but in actuallity it only occuplies a 1 tile space. What you're seeing is probably the wagon overlapping onto the water.
There's an issue in 1.2.5 where pathing can ignore structures in some edge cases. I have a fix in 1.3, but I could release it early if it really bugs you.
Edit: Masklings shouldn't ignore the walls, so don't worry about your defenses being useless.