TT #617 · Parashas Ki Seitzei · Seventh Aliyah · Passuk 25:02
And it shall be, if the wicked one is to be flogged, the judge shall cause him to lie down and be beaten in his presence, according to his guilt, by number.
Torah Temimah points to Makkot / Sifrei Devarim (Shoftim).
TT lemma: בִּן הַכּוֹת הָרָשָׁע.
Sefaria — Makkot / Sifrei Devarim (Shoftim)
English: Our Rabbis taught: From where do we know that if one leaves the court condemned and someone says ‘I have something to say in his favor,’ we bring him back? Scripture says ‘Do not kill the innocent.’ And from where do we know that if one leaves the court acquitted and someone says ‘I have something to say against him,’ we do not bring him back? Scripture says ‘Do not kill the righteous.’
Derash on contrasting terms (naki / tzaddik) — Custom (baraita).
A guilty verdict may be reopened if new favorable evidence appears; an acquittal may not be reopened even if new unfavorable evidence appears. The Torah protects the one already declared righteous more stringently.