Your first point is a good one, these ships base at locations specifically designed for transferring heavy loads. Adding battery swapping to the to-do list at container ports does not seem unreasonable at all.
To your second point, let it always be remembered that the first electric busses, from the early 20th century, used a battery swap system. It can be done, especially on industrial vehicles. Personally I don’t understand why it isn’t being done today for electrified bus networks.
How do you refuel at sea or even anchored near port? The recent West Coast US delays would be an example of a situation of that, along with the Suez Canal delay.
How do batteries disperse/degrade or get recovered at sea when the inevitable cargo loss or hull loss occurs?
Possibly the answer to both of those is systemic - but it is at least that.
I don't think at-sea refuelling is common for commercial ships, but if needed presumably a electric equivalent of an oiler could be made, with a electric cable instead of a hose used to transfer power from one ship to the other.
For the other issue... probably no perfect solution.
Its not really analogous though: smaller vehicles are dominated by aerodynamic concerns, and otherwise a cargo profile that's totally different (people).
Whereas ships are dominated by the cargo profile: shipping containers.
Edit: Probably wouldn't happen though. I feel like if swapping was gonna work, it would be done in smaller vehicles already