Negative commandment · Lo Ta’aseh #294 of 613
Not to punish a person forced [to commit a sin]
שלא לענוש האנוס
The verse · Devarim 22:26
וְלַנַּעֲרָ לֹא־תַעֲשֶׂה דָבָר אֵין לַנַּעֲרָ חֵטְא מָוֶת כִּי כַּאֲשֶׁר יָקוּם אִישׁ עַל־רֵעֵהוּ וּרְצָחוֹ נֶפֶשׁ כֵּן הַדָּבָר הַזֶּה
“but to the girl thou shalt do nothing; there is in the girl no sin worthy of death: for as when a man rises against his neighbour, and slays him, even so is this matter:”
The Rambam’s words
Not to punish a person forced [to commit a sin], as [Deuteronomy 22:26] states: "Do not do anything to the maiden."
שלא לענוש האנוס, שנאמר "וְלַנַּעֲרָה לֹא תַעֲשֶׂה דָּבָר" (דברים כב, כו).
Why · Sefer HaChinuch #556
Not to punish one coerced into a sin
“The root of this commandment is known to every person with intelligence — that it is not fitting to punish any creature for that which he does against his will [and] not for his own benefit.”
Who & when
“And this commandment is practiced in every place and at all times, that we are obligated not to give any punishment to one coerced.”
Where in the Mishneh Torah
Hilchot The Sanhedrin and the Penalties within Their Jurisdiction הלכות סנהדרין והעונשין המסורין להם