He attributed it to the Prophet ﷺ, who said, "Whoever goes to his bed intending to rise and pray during the night, but sleep overcomes him until morning, will have recorded for him what he intended, and his sleep will be a charity granted to him from his Lord."
يبلغ به النبي ﷺ قال: من أتى فراشه، وهو ينوي أن يقوم فيصلي من الليل فغلبته عيناه حتى يصبح كتب له ما نوى، وكان نومه صدقة عليه من ربه.
Nasai (1787) and Ibn Majah (1344) both narrated it from Harun bin Abdullah Hammal, who said, "Husayn bin Ali Jafi narrated to us, from Zaida, from Sulayman Amash, from Habib bin Abu Thabit, from Abda bin Abu Lubaba, from Suwayd bin Ghafla, from Abu Darda," and he related it. Ibn Khuzayma (1172) and Hakim (1/311) also transmitted it through the route of Habib bin Abu Thabit. Nasai and Ibn Khuzayma criticized it for being a stopped narration (mawquf).As for Hakim, he said, "It is sahih according to the criteria of the two Shaykhs, though they did not include it. What I hold is that they criticized it because of a stopping attributed by whoever narrated from Zaida," end of quote.I say, this is as he said, for Muawiya bin Amr contradicted him, narrating it from Zaida as a saying of Abu Darda, which Hakim also transmitted. Abdul-Razzaq (4228) also narrated it from Sufyan, from Abda with his chain, from Abu Dharr or Abu Darda, as a stopped narration. This stopped version was also narrated by Nasai and Ibn Khuzayma.However, Shuba narrated it from Abda bin Abu Lubaba, from Suwayd bin Ghafla, that he visited Zirr bin Hubaysh during his illness, and Abu Dharr, or Abu Darda (Shuba was uncertain), said that the Messenger of Allah ﷺ said, relating the hadith as a raised (marfu) narration. This was narrated by Ibn Hibban (2588) through the route of Miskin bin Bukayr, from Shuba, with this wording. However, it contains Muhammad bin Saeed Ansari, Abu Ishaq Harrani, the narrator from Miskin bin Bukayr, whom no one besides Ibn Hibban has affirmed as reliable. Al-Hafiz said in Taqrib, "A shaykh."Nevertheless, this route strengthens the earlier route containing Habib bin Abu Thabit, so the raised version becomes established both in ruling and in chain of transmission, even though some scholars of knowledge preferred the stopped version and then said, "Its ruling is that of a raised narration, since something like this cannot be said merely as personal opinion."