Abu Dhubyan reported,

Hannad al-Janbi reported that a woman who had committed fornication was brought to Umar, and he ordered that she be stoned. Ali رضي الله عنه passed by, took her, and set her free. Umar was informed of this and said, "Call Ali for me."Ali رضي الله عنه came and said, "Commander of the Faithful, you know that the Messenger of Allah ﷺ said, 'The pen has been lifted from three: from the child until he reaches puberty, from the sleeper until he wakes, and from the insane until he recovers.' This woman is the insane one of such-and-such tribe. Perhaps the one who lay with her did so while she was in her affliction."Umar said, "I do not know."Ali عليه السلام said, "And I do not know either."

Abu Dawud 4402

Daif

حدثنا هناد عن أبي الأحوص ح و حدثنا عثمان بن أبي شيبة حدثنا جرير المعنى عن عطاء بن السائب

عن أبي ظبيان قال

هناد الجنبي قال أتي عمر بامرأة قد فجرت فأمر برجمها فمر علي رضي الله عنه فأخذها فخلى سبيلها فأخبر عمر قال ادعوا لي عليا فجاء علي رضي الله عنه فقال يا أمير المؤمنين لقد علمت أن رسول الله ﷺ قال رفع القلم عن ثلاثة عن الصبي حتى يبلغ وعن النائم حتى يستيقظ وعن المعتوه حتى يبرأ وإن هذه معتوهة بني فلان لعل الذي أتاها وهي في بلائها قال فقال عمر لا أدري فقال علي عليه السلام وأنا لا أدري

أبو داود 4402ضعيف
Contents
Reference
Commentary
Ayat
Collection
Sunan Abu Dawud
Book
Legal punishments
Chapter
Insane person who steals or commits a crime deserving a hadd punishment
Numbering
Darussalam 4402
Abu Dawud 4402