The Messenger of Allah ﷺ said, "The pen is lifted from three, the child, the insane, and the sleeper."
حدثنا محمد بن بشار حدثنا روح بن عبادة حدثنا ابن جريج أنبأنا القاسم بن يزيد
أن رسول الله ﷺ قال يرفع القلم عن الصغير وعن المجنون وعن النائم
[Hasan]. Busiri said, "This chain is daif. This Qasim bin Yazid is unknown, and moreover he did not meet Ali bin Abu Talib. The preceding hadith serves as a corroborating witness for it."