I heard Shaybi say, "Someone who passed by an isolated grave with the Prophet ﷺ informed me that the Prophet ﷺ led them in prayer, and they lined up in rows behind him."I asked, "Abu Amr, who narrated this to you?"He replied, "Ibn Abbas."In another narration from Ibn Abbas, he said, "A man whom the Messenger of Allah ﷺ used to visit during his illness died at night, and they buried him during the night. When morning came, they informed the Messenger of Allah ﷺ of his death."He asked, "What prevented you from letting me know?"They replied, "It was night and very dark, and we did not want to burden you."So he went to the grave and performed the funeral prayer over him.
سمعت الشعبي قال: أخبرني من مر مع النبي ﷺ على قبر منبوذ فأمهم، وصفوا عليه، فقلت: يا أبا عمرو! من حدثك؟ قال: ابن عباس. وفي رواية: عن ابن عباس قال: مات إنسان كان رسول الله ﷺ يعوده فمات بالليل، فدفنوه ليلا، فلما أصبح أخبروه فقال: ما منعكم أن تعلموني؟ قالوا: كان الليل فكرهنا- وكانت ظلمة- أن نشق عليك، فأتى قبره فصلى عليه.
Bukhari narrated it in the Book of Adhan (857), and Muslim narrated it in the Book of Funerals (954), both from the hadith of Muhammad bin Jafar Ghundar, who said, Shubah narrated to us, from Sulayman Shaybani, and he related it.The second narration is found in Bukhari (1247) through the route of Abu Muawiya, from Shaybani. The two sheikhs [Bukhari and Muslim] also narrated it through other routes from Sulayman Shaybani with the same wording, except that in the route of Abdullah bin Idris, from Shaybani, in Muslim, there is an addition, "and he said the takbir four times."As for what Daraqutni narrated (2/78) through the route of Hurayim bin Sufyan, from Shaybani, from Shaybi, from Ibn Abbas, that the Prophet ﷺ performed the funeral prayer over a deceased person three days after his death, the wording "three" is shadh (anomalous), as more than one scholar has stated, and the correct view is that he prayed over him on the morning of his burial.