There's a difference between the ministration and administration of justice. Discretion, uncertainty, and inefficiency are rampant and essential in criminal justice.
Nobody expects perfection .
That would neither be good nor fair. Justice is a sporting event in which playing fair is more important than winning. Law enactment, enforcement, and administration all involve trading off the possibility of perfect outcomes for security against the worst outcomes. The law simply does NOT cover every situation that a police officer encounters in the field. Laws are passed in a vacuum, and usually written quite narrowly.