That creates a "dream sequence" that I sincerely hope does not see the cold light of day. "Shooter offing himself as soon as confronted" is the official prty line and works well for keeping the cops willing to go in as soon as on the scene as opposed to waiting for backup and stops the sheep from running off the cliff in fear at first sight of something they think might be a wolf.
I would say that about half of the disarm techniques I've seen involve using the assailant's body as the "relatively safe direction" to get the gun pointed while you're in the process of trying to take it away and/or disable the assailant to the point of making it less relevant.
Then again, every time there's a school shooter/suicide, I have to wonder if there's some detective with a conscience who looked at the situation and said to himself, "Hmm, no powder burns, and it looks like a different caliber from anything he was carrying, but I don't
see a teacher carrying illegally, so it's obviously suicide."