It seems to me the parent comment you respond to refers to handling of an actively developing "immediate danger to the public" situation by law enforcement, where judgement calls have to be made, sometimes ones of lethal consequence.
... but that's an entirely different debate from death penalty after facts have occurred.
It's interesting seeing police around the world handling such things:
HELSINKI (AP) — A man stabbed eight people Friday in Finland’s western city of Turku, killing two of them, before police shot him in the thigh and detained him, police said. Authorities were looking for more potential suspects in the attack.
I've seen many examples of police engaging with firearms in the US that are eye watering .. eg: police firing across an intersection with moving traffic into a darkened mall | storefront that active shooters retreated into .. so, no clear line of sight, chance of hitting car that crosses fire line, chance of hitting innocents deeper in store, etc.
I have seen PoliceActivity videos and such, it is indeed crazy what is going on in the US wrt. shootings (from cops and others alike).
Or calling the cops on your family member because they are in psychosis or what have you, and they end up killing a member of your family. I do not think I would ever call the cops in the US to deal with such cases.
Few days ago I saw on Reddit police video where officer shot guy who resisted arrest. Redditors were applauding to officer, probably because it was Jan 6 insurrectionist but still I was in shock. Yes the officer could have been in danger but this would hardly happen in my country. Police officers are not nice here but they do not expect most people could have gun. So they do not execute people escaping the arrest. I find it insane how casual were Americans about that.
I've heard it said that the defense lawyers job is to make sure that the court does their job and the prosecution does their job and the police did their job.
They may know that the person is going to be sentenced to death, but they still need to make sure that the state does everything right because that's the only ethical thing to do.