Like most accidents more than one thing done wrong. First firing into a knot. You can see 95% of all knots and certainly the ones big enough to deflect a nail. Second, another worker was somewhere around the nail gun operator. Any nail gun operators manual will say, do not operate with other workers anywhere near. So that if something does go wrong, nobody is around to suffer the consequences. I have operated nail guns for decades and watched others too, I will say it is a dangerous tool that is often handled by ininformed and careless operators. The only way a nail gun can put a nail into your hand is if your hand is in front of the gun, which is probably the first caution in every owner's manual. Along with do not move around with your finger on the trigger.