I've seen speculation that for Hogwarts at least it might be the lightning protections (in whatever way they work) causing the issues mentioned. I can't remember if anyone in canon used something like a lighning spell, so...
The other speculation I sometimes see is that magic and electricity are tying to use the same paths/circuits and that clash is causing the probable issues, thus EMP protection like a Faraday Cage would work (and in several fic it does).
The other speculation I sometimes see is that magic and electricity are tying to use the same paths/circuits and that clash is causing the probable issues, thus EMP protection like a Faraday Cage would work (and in several fic it does).