This is just so scary.
How could this have been avoided?
Let’s start with not using a loaded weapon to do movement and training.
Then let’s go to trigger discipline. If your finger isn’t on the trigger, you don’t have to worry about accidentally pulling it quite so much.
Treat every weapon like its loaded. Every time.