Hmm, that sounds like the fan switch is creating an electrical spike, either through the mains or even a bit of an electromagnetic interference that is knocking your hardware out of whack. I’ve seen these old-timey rotary switches actually throwing sparks when switching - not a healthy thing around sensitive electronics. Or the fan electronics are affecting the power level - electrical motors can pull a lot of power when starting up, which could create a short-term voltage dip. Or worse, when turned off, they can actually create power peaks back to the mains, which could affect your laptop and periphery. Definitely not a healthy thing - over time, this is very likely to damage your computer and attached devices, so you should definitely do something about this.
First thing I’d do is use some ferrite cores on your USB cables - that can help sometimes. And these gadgets are pretty cheap, so won’t hurt trying. But I suspect these won’t really eliminate the problem - ferrite cores help more with interference, not so much against brute force voltage glitches. But worth a try.
If the voltage glitch affects mains voltage, a battery-buffered power supply or power conditioner for your sensitive equipment could help.
Have you tested if your keyboard is affected by the power glitch when your laptop is running on battery only, i.e. not plugged into the mains with the ventilator? If yes, then it looks like some spark EMP is transmitting wirelessly - more difficult to protect against, and TBH that fan wouldn’t be something I’d like to have around my equipment in any case.
If the issue goes away when you run the laptop and keyboard from battery only, this suggests that the glitch transmits via the power connection. In that case, a power conditioner or mains filter would be the thing to try.
You should definitely do something about this - you’re risking damage to your equipment every time this happens. If your drummer isn’t open to reasonable suggestions (i.e. change to a less intrusive fan), you should definitely try to insulate your power supply from his equipment by means of a power conditioner / surge protector
I am using a combination of battery-buffered UPS and surge protector for my stage setup (Eaton 3S 700) - looks like an oversized multi-socket power distributor, but weighs a bit more (4 kg). I power my keyboard setup and our digital mixer from it - a good thing to have when stage power supply is a bit dodgy. And it cost me roughly 100 EUR, which is a reasonable investment compared to the value of my stage kit…