Anyone that has ever taken even a basic gun safty course knows that 1 you never hand someone a loaded and chambered gun and 2 when you are handed a gun the first thing you do is check to see if it is loaded/chambered.(the real first rule is never point your gun at anything you do t want to destroy but that does not apply to this situation)
This was extreme negligence from top to bottom and if even 1 person on set that day that handled that gun(especially the last peraon to have it the actor) did their job correctly no one would be dead.