TT #634 · Parshas Ki Seitzei · Seventh Aliyah · Passuk 25:03
Forty times he shall strike him; he shall not add, lest he continue to strike him beyond these with a great blow, and your brother be degraded before your eyes.
Torah Temimah points to Makkos 22b / Tosafos Sotah 8a.
TT lemma: וְנִקְלָה.
Sefaria — Makkos 22b / Tosafos Sotah 8a
English: ‘And he be degraded’ – how do they flog him? The officer of the synagogue takes hold of his garments; if they tear they tear, if they rip they rip, until he exposes his heart, because it is written ‘and your brother be degraded’ – it is a mitzvah to degrade him.
Derash establishing the procedure of exposure (Bavli / Tosafos).
Part of the penalty is the public exposure of the upper body; the garments are torn open so that the degradation is visible and complete.