It's true that I assume some parameters to the equation but I have learned that these are valid assumptions in 99% of all cases. I assumed that the problem is shore side simply because the differential still exist when the boat is completely powered down as demonstrated by the spark. Even when the boat has ground shorted to both neutral and hot... if the boat is powered down and the spark occurs, it is caused by a shore ground that is faulty.
I also assumed that the boat is indeed powered down so no genset running and batteries disconnected.
I often see a voltage of between 2- and 80V in shore power sockets between the neutral and ground leads (should be zero). The problem is often that the wiring
is too small diameter and too long for the power transfer it is used for... leading to all that nastyness.
An isolation transformer deals with every possible AC grounding problem between boat and shore. It also deals with inverse polarity. The only thing left to check is measuring insulation
value between ship ground points (preferable at every outlet and direct connection) and the water
exposed grounding plate/metal; and between hot and neutral wires and the ground wire aboard.
A galvanic isolator doesn't protect against AC differentials and neither against big enough DC differentials (diodes go to conducting state and protection is void). This means that galvanic protection is also lost
with an AC differential. It also doesn't improve safety
aboard for the crew. I strongly disagree with the view that the isolation transformer is just an expensive replacement for a galvanic isolator. It's the other way around: a galvanic isolator is a cheap
but flawed replacement for an isolation transformer ;-)
There was an extensive thread about this in CF before; the search function should come up with it.
In short: from here I diagnose the problem as a voltage differential between the ground supplied by the shore power console and the real ground, which is common. The marina blames the boat... what's new.