I believe the F-16 has a lockout that's engaged when the gear is extended...perhaps
BiffF15
might have better details, but going back to a maintenance guy working on a live aircraft, how was that even permitted?
And even then, the discharge of the cannon cannot be "accidental", it has to be switched on and the trigger depressed...you don't just "bump" something and it goes off like that.