It is narrated from Abu Umamah (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) offered the funeral prayer at the grave of a poor woman who had passed away during the night.
Hadith Referenceمسند الإمام الشافعي / كتاب الجنائز / 594
Hadith Takhrijصحیح اخرجه النسائي، الجنائز، باب الصلاة على الجنازة بالليل (1971) ۔ اخرجه البيهقي في المعرفة السنن والآثار (2160) ۔ وعبدالرزاق (6394)۔
Abu Umamah bin Sahl bin Hunaif (may Allah be pleased with him) narrates that a poor woman fell ill, and the Prophet (peace and blessings be upon him) was informed about her illness. Umamah says that it was the blessed habit of the Messenger of Allah (peace and blessings be upon him) that he would visit the sick and inquire about them. The Messenger of Allah (peace and blessings be upon him) said: "When this woman passes away, inform me as well." The people took her funeral out at night and disliked waking the Messenger of Allah (peace and blessings be upon him). In the morning, the Messenger of Allah (peace and blessings be upon him) was informed about her, so he said: "Did I not tell you to inform me?" The Companions (may Allah be pleased with them) submitted: "O Messenger of Allah (peace and blessings be upon you)! We did not consider it appropriate to wake you at night." Then the Messenger of Allah (peace and blessings be upon him) went out, and the people formed rows at her grave, and he led the funeral prayer and said four takbirs.
Hadith Referenceمسند الإمام الشافعي / كتاب الجنائز / 595
Hadith Takhrijصحیح اخرجه النسائي، الجنائز، باب الصلاة على الجنازة بالليل (1971) ۔ اخرجه البيهقي في المعرفة السنن والآثار (2160) ۔ وعبدالرزاق (6394)۔