Except there was a police officer right outside the building that engaged:
> The suspect was immediately engaged outside the building as he approached the school by a Uvalde Independent School District police officer, who was shot by the suspect, the sources said.
* https://abcnews.go.com/US/texas-elementary-school-reports-ac...
Not the first time even an immediate reaction still didn't prevent deaths and injuries:
> Police at the scene engaged him within a minute of the first shots being fired, firing 18 rounds and hitting the gunman several times.[5] The police chief credited the fast response to a heavy police presence with "many, many officers in the park".[18]
* https://en.wikipedia.org/wiki/Gilroy_Garlic_Festival_shootin...