The Prophet ﷺ prayed over a man after he had been buried for a night. He stood with his companions, having asked about him, "Who is this?"They replied, "So-and-so. He was buried last night."So they prayed over him.
صلى النبي ﷺ على رجل بعد ما دفن بليلة، قام هو وأصحابه، وكان سأل عنه فقال: من هذا؟ فقالوا: فلان، دفن البارحة، فضلوا عليه.
Bukhari narrated it in the book of funerals (1340) from Uthman bin Abu Shayba, who said, Jareer narrated to us, from Shaybani, from Shaybi, from Ibn Abbas, and he mentioned it.This contains evidence for those who hold that burial at night is permissible, because the Prophet ﷺ did not object to their burying him at night. Rather, he objected to their not informing him of the matter. It has been established as sahih that Abu Bakr was buried at night, and that Ali bin Abu Talib buried Fatimah at night, and no objection from any of the companions to burial at night has been reported. Indeed, it is established that the Prophet ﷺ himself was also buried at night, and the details of this will come later in the biography.