I could understand this if they were literally surrounded by walls, but according to my understanding having a wall to the left and right isn't called enclosed. Why would this suffice to avoid the prohibition of techumin? There was a breach in front of them and behind them. I recall there's an opinion somewhere that the sea split to form a semi circle, but I don't think that would help.
(Yes I'm aware this is drush not halacha)