Yevamot 106 - Chalitzah in prison

A chalitzah was once performed with just the brother of the late husband and the wife present, in prison, and Rabbi Akiva declared it kosher.

Let's look closer. Granted there was no "court" in prison, but if there are no witnesses, the event is considered as if it did not happen, so how could it be kosher? - In truth, there were witnesses, but they stood outside.

Actually, who was in prison? - The story happened when the man and the woman were in prison, but Rabbi Akiva was also in prison at this time. More details: Rabbi Yochanan Sandler pretended to be a peddler. He cried, "Who wants needles? does anyone want knitting knots? What about a chalitzah between only him and her?" Rabbi Akiva heard and answered, "Do you have spindles ("koshin")? do you have kosher?" - and that indicated his decision on the matter.

A mistaken chalitzah is nevertheless valid. How so? One man wanted to do yibum to a woman just because of her money, but she did not want him. The judge told him, "Make a chalitzah, and with this you will acquire her." The brother did so. Then the judge said, "Really, you are now disqualified from marrying her, so why not give her a real chalitzah?" and the brother had to comply.

Art: Tasso in the Prison by Louis Gallait