Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
muslim:931Khalaf b. Hishām And ʾAbū al-Rabīʿ al-Zahrānī > Ḥammād > Khalaf > Ḥammād b. Zayd > Hishām b. ʿUrwah from his father > Dhukir ʿInd ʿĀʾishah Qawl Ibn ʿUmar al-Mayyit Yuʿadhhab Bibukāʾ Ahlih ʿAlayh > Raḥim Allāh Abū ʿAbd al-Raḥman

May Allah have mercy upon Abu 'Abd al-Rahman (the kunya of Ibn 'Umar) that he heard something but could not retain it (well). (The fact is) that the bier of a Jew passed before the Messenger of Allah ﷺ and (the members of his family) were waiting over him. Upon this he said: You are wailing and he is being punished.  

مسلم:٩٣١وَحَدَّثَنَا خَلَفُ بْنُ هِشَامٍ وَأَبُو الرَّبِيعِ الزَّهْرَانِيُّ جَمِيعًا عَنْ حَمَّادٍ قَالَ خَلَفٌ حَدَّثَنَا حَمَّادُ بْنُ زَيْدٍ عَنْ هِشَامِ بْنِ عُرْوَةَ عَنْ أَبِيهِ قَالَ ذُكِرَ عِنْدَ عَائِشَةَ قَوْلُ ابْنِ عُمَرَ الْمَيِّتُ يُعَذَّبُ بِبُكَاءِ أَهْلِهِ عَلَيْهِ فَقَالَتْ رَحِمَ اللَّهُ أَبَا عَبْدِ الرَّحْمَنِ

سَمِعَ شَيْئًا فَلَمْ يَحْفَظْهُ إِنَّمَا مَرَّتْ عَلَى رَسُولِ اللَّهِ ﷺ جَنَازَةُ يَهُودِيٍّ وَهُمْ يَبْكُونَ عَلَيْهِ فَقَالَ أَنْتُمْ تَبْكُونَ وَإِنَّهُ لَيُعَذَّبُ