It was narrated from Al-Hasan that `Umar bin Al-Khattab (رضي الله عنه) wanted to stone an insane woman, but ‘Ali said to him:
You do not have the right to do that. He said: I heard the Messenger of Allah (ﷺ) say: “The Pen has been lifted from three: from the sleeper until he wakes up, from the child until he reaches adolescence, and from the insane person until he recovers, or comes to his senses.` So `Umar (رضي الله عنه) pardoned her.