I heard the Messenger of Allah ﷺ saying: He who is lamented upon would be punished because of the lamentation for him on the Day of judgment. (Using translation from Muslim 933a)
سَمِعْتُ رَسُولَ اللهِ ﷺ يَقُولُ مَنْ نِيحَ عَلَيْهِ فَإِنَّهُ يُعَذَّبُ بِمَا نِيحَ عَلَيْهِ يَوْمَ الْقِيَامَةِ