Jabir bin Abdullah reported that the Prophet ﷺ was giving a sermon one day when he mentioned a man from among his companions who had passed away, been shrouded in an inadequate shroud, and buried at night. The Prophet ﷺ forbade burying a person at night before the funeral prayer is performed over him, unless someone is compelled by necessity to do so.The Prophet ﷺ said, "When one of you shrouds his brother, let him shroud him well."
أنه سمع جابر بن عبد الله يحدث أن النبي ﷺ خطيب يوما فذكر رجلا من أصحابه قبض، فكفن في كفن غير طائل، وقبر ليلا، فزجر النبي ﷺ أن يقبر الرجل بالليل حتى يصلي عليه، إلا أن يضطر إنسان إلى ذلك، وقال النبي ﷺ: إذا كفن أحدكم أخاه فليحسن كفنه.
Muslim narrated it in the Book of Funerals (943) through several routes from Hajjaj bin Muhammad, who said, Ibn Jurayj said, Abu Zubayr told me, and then he related it.It has been said regarding this hadith that the prohibition was because the Prophet ﷺ, peace be upon him, had not offered the funeral prayer over him, and that he was not prohibiting mere burial at night in itself, or that it was due to the small number of those praying, or because of a poor shroud, or because of the combination of these factors, all of which are possible explanations.As for what was reported from Ibn Umar that the Prophet ﷺ said, "Do not bury your dead at night," this is daif. Ibn Jawzi narrated it in Ilal Mutanahiya (2/427) and said, it contains Muhammad bin Imran bin Abu Layla, of whom Bukhari said, his hadith is munkar. End of quote.