I thought these sorts of planes would have a safety. And if the safety is designed in such a way without i.e. interlocks and such that you can fire off guns accidentally by poking around in the wires/connectors, that's a little sad.
Now sometimes the weight on wheels switches need to be bypassed for testing a wide range of aircraft systems. Perhaps the aircraft was on jacks (tyre replacement?) or some sort of EMI occurred... But ultimately there really is a great deal of safety layers that had to be compromised for this to happen, including human factors.
Like with software development, you can't predict every possible action of your users (air or ground crew), and sooner or later you'll encounter an edge case nobody had considered.