If the Uvalde officer who supposedly had his AR-15 aimed at the shooter while the shooter was still outside of the school had opened fire on the shooter and hit him do you really think the kid would have continued his attack on the school?
Given that narrowly scoped scenario? Probably not. Bur your supposition was not the reality of the situation.
That was not a viable scenario, based on reports.
So, my observation stands. You cannot conflate the two situations.