Voltage across transformer primary to secondary - ways to mitigate
I think your expectations are wrong. If the primary and secondary are isolated, you should expect to see some random voltage develop between them.

If the voltage between them were consistently 0 V, that would be a sign that they are electrically connected and that the isolation has failed.

As another answer points out, you may not want perfect isolation in order to protect the secondary from damage due to electrostatic discharge. But even so you might only constrain the floating voltage with back-to-back TVS diodes or a spark gap, which would still allow the voltage between the two sides to vary by 100's of V.

And many isolated systems won't have any such coupling at all. In fact if the isolation is for safety reasons they will likely have to pass a "hipot" test to show that 100's or 1000's of volts can be applied between the primary and secondary without appreciable current flowing.