A strange legal reality that many folks may not realize is that law enforcement does not actually have a duty to protect people from harm. They have a job to do that, for sure, but merely doing the job of law enforcement poorly or in an ineffective manner will not, in general, give rise to legal liability. The classic Supreme Court case on this idea is DeShaney v. Winnebago, from 1989.
The way the courts look at it is that officers have a duty to the general public … but not to any specific person. Therefore if a specific person gets harmed through some failure of law enforcement, that’s not the basis for a lawsuit.
There are exceptions to this general rule when the state itself creates a dangerous condition, and some of those exceptions occur specifically when individuals are held in a custodial environment, such as a jail.
So what about a situation like the fiasco in Uvalde, where law enforcement stood around and did nothing as 21 children were murdered in a mass shooting? Massive litigation has been launched in response to that incident, but some critics have been very skeptical about the prospects for that litigation to prevail. In that situation, as in every other, the overall optics of the situation may sway the legal analysis to a degree.
But the sobering baseline legal reality, in general, is that law enforcement is not on the hook merely because it fails to protect a particular person.