I run into a similar problem. I have a power-hungry GPU (3080) and CPU (9800X3D). All my audio equipment was on the same UPS (and therefore outlet) as my gaming PC. The result is that any time a particularly stressful game would be open, I'd get buzzing in the speakers. (Especially if the framerate was at 360) If you ask audiophiles online they will swear up and down that a cheater plug, balanced cables, or optical i…
Your problem of an AC power supply not sufficiently filtering out high-frequency noise from mains is exceptionally rare to the point that yes, I also don’t believe that was the correct diagnosis of your issue.