The goal of the galvanic isolation is basically to cut off the noise coming from the source, PC for example.
The goal of galvanic isolation is to prevent ground loops, and not quite as your explanation above.
Most good quality CD players from the 1980's had a small transformer on the coaxial output for this very purpose, although as most CD players were double insulated (and as such had no ground connection) ground loops were typically not an issue, although the CD player could still have a path to ground via the RCA interconnects for example (if the amp was earthed).
Some DACs also had an input transformer although those were not very common.