As an employee of ISS (Independent Studio Services) and having worked a number of TV shows and movies, I can certainly say that had proper procedures for the use of firearms on set had been followed this incident would not have occurred. This is criminal negligence, plain and simple.
Note, most movie firearms are in fact real firearms, and capable of firing live ammunition. Semiauto and fullauto guns are modified for function by placing a regulator in the barrel and removing the locking mechanism (if any). Blanks can be 1/4, 1/2 or full flash, which is why you see the flash even in daylight. CGI is only used on occasion as it is so much more expensive that blanks.
If the scene does require the weapon to be fired, or parts actuated, a dummy gun is almost always used instead. These are rubber replicas and totally non functional. You can sometimes see this, for example in Road to Perdition, where Tom Hanks goes to the hotel and shoots Daniel Craig in the bathtub. That is a rubber gun, the hammer is down on a 1911 (prevents breaking it off) and no parts move when the firing takes place, its just an effect dubbed in during post production.
Firing scenes are carefully blocked and staged to prevent injury. Actors often know less than nothing about the firearms or their operation, so don't expect them to check anything, that's the job of the prop master, along with proper briefing of everyone who will be on set at the time. I will show you the firearm, brief you on the operations and show you the loading process and the fact that it is properly ready.
I do a number of shows that are live action, using live guns with live ammo. That is NOT the same as shooting a movie. Movie sets HAVE NO LIVE AMMO ON SET. Special effects where live fire is required/desired are filmed seperatly from the actors scenes and in a different location. Another example, I worked on sound and effects for Dunkirk, where live fire was requested for sound and visuals (tracer) rather that CGI. That was filmed here at Gunsite on the HK range, shooting over an IMAX camera with a microphone farm to capture audio. No actors, in fact, not even the director, just effects guys and grips.
There is no excuse for this gross negligence, and I should hope that proper criminal charges are brought on the parties involved and the following civil suit should be quick and massive.