He ascended the pulpit, praised Allah and glorified Him, then said, "What is this wailing doing in Islam? I heard the Messenger of Allah ﷺ say, 'Whoever is wailed over is punished for what is wailed over him.'"
حدثنا أحمد بن منيع حدثنا قران بن تمام ومروان بن معاوية ويزيد بن هارون عن سعيد بن عبيد الطائي عن علي بن ربيعة الأسدي قال مات رجل من الأنصار يقال له قرظة بن كعب فنيح عليه فجاء
فصعد المنبر فحمد الله وأثنى عليه وقال ما بال النوح في الإسلام أما إني سمعت رسول الله ﷺ يقول من نيح عليه عذب بما نيح عليه
Sourced. Agreed upon. Muslim narrated it in "Funerals," chapter "The deceased is punished for the weeping of his family over him," hadith 933, from the narration of Marwan Fazari, and Bukhari narrated it, hadith 1291, from the narration of Saeed Tai, with the same wording.On this topic there are also narrations from Umar [forthcoming at 1002], Ali [Ibn Abu Shayba 3/64, hadith 12103], Abu Musa [forthcoming at 1003], Qays bin Asim [Nasai, hadith 1852], Abu Hurairah [forthcoming at 1001, and Muslim, hadith 67], Junada bin Malik [Tabarani in al-Kabir 22/282, hadith 2178], Anas [Muslim, hadith 21/927], Umm Atiya [Bukhari, hadith 1306, and Muslim, hadith 936], Samura [Ahmad 5/10], and Abu Malik Ashari [Muslim, hadith 934].