I experienced the same issue after moving my printer to the other end of the room and connected it by a 3 meter extension cable. About eight of ten times I switched off the light the USB connection was lost with a catastrophic result for my print: i.e. it was destroyed.
I’ve tried several things: changing mains from the outlet next to the light switch to another outlet via an extension cord. The effect was that the light could be switched on and off without fear, but then my desk light took over. Also switching my hobby power supply on the same desk caused USB breakdown. Later I noticed that it didn’t matter if the K8200 print was powered or not. So I’ve tried a ferrite core on the USB cable, another surely shielded cable, but without result.
Then I got the luminous idea to change from a USB port on the front, to a USB port on the back of my PC, and from then I can switch on and off everything. Even abusing a light switch by holding the button and therewith making it bounce doesn’t kill the USB connection.