...there is absolutely no moral equivalence between an innocent person executed and an innocent person who spends some time in prison and is freed.Now you are moving from moral questions to empirical ones.
Consider two hypothetical options - one is a 10% chance of being wrongfully convicted and being executed. The other is a a 20% chance of being wrongfully convicted and locked in jail with a 25% chance of being later exonerated, resulting in a 15% chance of being wrongfully locked in jail until one dies.
I'd suggest that morally, a 10% chance of wrongful execution is better than a 15% chance of being locked in jail until death + 5% chance of being locked in jail for years until exoneration.
In any case, this probabilistic example invalidates your absolute claim that imprisonment is better because someone might later be exonerated.
Because they might be innocent?
Apriori, I'm asking you to distinguish between:
a) imprisoning until death a guilty person or executing them.
b) imprisoning until death an innocent person or executing them.
As far as putting people into the wrong categories, that's a probabilistic matter rather than a moral one.