Abu Zabyan (may Allah have mercy on him) said that a woman who had committed a sin was brought to Umar (may Allah be pleased with him). Umar (may Allah be pleased with him) ordered that she be stoned, and then Ali (may Allah be pleased with him) passed by there. When Ali (may Allah be pleased with him) learned that she was being taken to be stoned, he took the woman and let her go her way. Then they came to Umar (may Allah be pleased with him) and informed him that Ali (may Allah be pleased with him) had let the woman go her way, so Umar (may Allah be pleased with him) said: "Call Ali (may Allah be pleased with him)." When Ali (may Allah be pleased with him) came, Ali (may Allah be pleased with him) said: "O Commander of the Believers! By Allah! You know that the Messenger of Allah (peace and blessings be upon him) (said): 'The pen has been lifted from three kinds of people: (1) the child until he reaches puberty, (2) the sleeper until he wakes up, (3) the insane person until he recovers.' This is the insane woman of such-and-such a tribe; perhaps the one who came to her came to her while she was in her affliction." Umar (may Allah be pleased with him) said: "I do not know." And Ali (may Allah be pleased with him) also said: "I do not know either."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب السرقة / 17212