Sounds like a head seperation to me. Out of battery firing is tough to get in AR15's because of the way it is built.
What happens in the firing sequence is that the firing pin shoves the case forward until the case shoulder reaches the chamber shoulder. Then, as powder pressure builds, the neck and shoulder and most of the body sticks to the chamber wall, and the case head is shoved back to the bolt, stretching the case near the head. If you reload it a bunch of times, or if the headspace is excessive, or if an anneal step was missed during the case drawing sequence, this failure will happen. You can either have too long chamber, too short ammo, or both.
You just witnessed that a head seperation can damage mags with leaking gas, endanger your eyes with flying particles, but will not necessarily destroy the rifle.
Check the gun headspace, the ammo headspace, and suspect the cases of being brittle too. Learn from this.