Sayyiduna Ka'b bin Ujrah (may Allah be pleased with him) narrates: I was present with the Prophet (peace and blessings be upon him) at two gatherings. In one of them a funeral was brought, and it was said: "This is so-and-so, and he was a bad man," and evil was spoken of him. The Prophet (peace and blessings be upon him) asked: "Do you know that?" The people said: "Yes." The Prophet (peace and blessings be upon him) said: "It has become due." Then in another gathering the funeral of a man was brought, and the people said: "This is so-and-so." The people spoke of his good, and the Prophet (peace and blessings be upon him) asked: "Do you know that?" The people said: "Yes." The Prophet (peace and blessings be upon him) said: "It has become due."
Imam al-Tabarani recorded it in al-Mu'jam al-Kabir. Its chain contains a narrator, Abdul-Aziz bin Ubaydullah bin Hamzah, and he is da'if (weak).
Hadith Referenceمجمع الزوائد ومنبع الفوائد / كتاب الجنائز / 3963