Ibn Abbas said: A lunatic woman passed by Ali ibn AbuTalib. He then mentioned the rest of the tradition to the same effect as Uthman mentioned. This version has: Do you not remember that the Messenger of Allah ﷺ has said: There are three whose actions are not recorded: a lunatic whose mind is deranged till he is restored to consciousness, a sleeper till he awakes, and a boy till he reaches puberty? (Using translation from Abū Dāʾūd 4401)
وَقَالَ لِعُمَرَ يَا أَمِيرَ الْمُؤْمِنِينَ أُتَرْجُمُ هَذِهِ؟ قَالَ نَعَمْ قَالَ أَوَ مَا تَذْكُرُ أَنَّ رَسُولَ اللَّهِ ﷺ قَالَ «رُفِعَ الْقَلَمُ عَنْ ثَلَاثٍ عَنِ الْمَجْنُونِ الْمَغْلُوبِ عَلَى عَقْلِهِ وَعَنِ النَّائِمِ حَتَّى يَسْتَيْقِظَ وَعَنِ الصَّبِيِّ حَتَّى يَحْتَلِمَ» ؟ قَالَ صَدَقْتَ فَخَلَّى عَنْهَا