A Jewish Court is allowed to kill a person if it considers the killing worthy even if it is unlawful by the existing Jewish Halacha. This is called עונשין שלא מן הדין (Meggilat Taanit 86, also Sanhedrin 46a and Rambam Sanhedrin 24,4):
אמר רבי אליעזר בן יעקב שמעתי שב"ד מלקין והורגין שלא מן התורה. דבית לוי אמרו שמעתי שב"ד עונשין ממון ומכים שלא מן התורה. לא מפני שכתוב בתורה אלא משום שנאמר ובערת הרע מקרבך...
שוב מעשה באחד שרכב על הסוס בשבת והביאוהו לב"ד וסקלוהו וכי חייב היה אלא שהיתה השעה צריכה לכך כדי שילמדו אחרים:
As we see a person was killed just because the court thought it was a good idea to teach others, not because of the magnitude of his own sin.
As a Baal Teshuva (a newcomer to Judaism) I would assume exactly the opposite - that the court would be allowed to unlawfully minimize or skip the punishment altogether if they see a need:
Because we value life so much (needless to source) and we're so Rachmanim sons of Rachmanim, etc.
Because it is a positive Mitzvah to mimic G-d in His positive traits (Rambam Deos 1,6) - so if He is Rachum and skips, deters or postpones punishment (see Rambam Hilchos Teshuvah that G-d forgives and pardons and ignores our misdeeds) we are commanded to do so.
After all, we do have various mechanisms of preferring teaching Zchus over Chova - swaying the judgment toward exempting from punishment (only applies to the death punishment).
So imagine a woman suffering domestic violence and abuse from her husband who also refuses to divorce her. She has no authority to complain to and the court plays powerless in helping her out. One day she decides to kill him in a cold blood in front of 2 Kosher witnesses that warn her and she confirms the warning. She's taken to the court and the court, while finding her clearly guilty, pardons her from being executed.
So in the Jewish criminal law (corporal or death punishment) is there a concept of מוחלין מן הדין - unlawfully pardoning a sinner (out of true considerations of course) and if not - why is that?