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.
quran:2:134

That was a nation which has passed on. It will have ˹the consequence of˺ what it earned, and you will have what you have earned. And you will not be asked about what they used to do.  

That (tilka, is the subject of this sentence and denotes Abraham, Jacob and his sons, and is feminine because it agrees with the gender of its predicate) is a community that has passed away, has gone before; theirs is what they have earned, the reward for their deeds (lahā mā kasabat, theirs is what they have earned’, constitutes the commencement of a new sentence) and yours (the Jews are being addressed here) is what you have earned; you shall not be asked about what they did, in the same way that they will not be asked about what you did, this latter statement being an affirmation of the former.
القرآن:٢:١٣٤

تِلْكَ أُمَّةٌ قَدْ خَلَتْ ۖ لَهَا مَا كَسَبَتْ وَلَكُمْ مَا كَسَبْتُمْ ۖ وَلَا تُسْأَلُونَ عَمَّا كَانُوا يَعْمَلُونَ  

{تلك} مبتدأ والإشارة إلى إبراهيم ويعقوب وبينهما وأُنِّث لتأنيث خبره {أمة قد خلت} سلفت {لها ما كسبت} من العمل أي جزاؤه استئناف {ولكم} الخطاب لليهود {ما كسبتم ولا تُسألون عما كانوا يعلمون} كما لا يسألون عن عملكم والجملة تأكيد لما قبلها.

See similar narrations below:

Collected by Qurʾān, Ṭabarānī
quran:2:141

That is a nation which has passed on. It will have ˹the consequence of˺ what it earned, and you will have what you have earned. And you will not be asked about what they used to do.  

That is a community that has passed away; theirs is what they have earned, and yours is what you have earned; you shall not be asked about what they did: a similar ˹verse˺ has already been mentioned above.
القرآن:٢:١٤١

تِلْكَ أُمَّةٌ قَدْ خَلَتْ ۖ لَهَا مَا كَسَبَتْ وَلَكُمْ مَا كَسَبْتُمْ ۖ وَلَا تُسْأَلُونَ عَمَّا كَانُوا يَعْمَلُونَ  

{تلك أمة قد خلت لها ما كسبت ولكم ما كسبتم ولا تُسألون عما كانوا يعملون} تقدم مثله.
tabarani:170Muḥammad b. Idrīs b. ʿĀṣim al-Jammāl al-Baghdādī > Isḥāq b. Rāhawayh > Yaʿlá b. ʿUbayd > al-Aʿmash > Abū Rāshid > Jāʾ Rijāl from Ahl al-Baṣrah > ʿUbayd b. ʿUmayr Faqālūā In Ikhwānak from Ahl al-Baṣrah Yasʾalūnak > ʿAlī And ʿUthmān ؓ ā > Wamā Aqdamakum Shayʾ Ghayr Hadhā > Naʿam

[Machine] "And what brought you forth, nothing except this?" They said, "Yes indeed." He said, "That nation has gone before, and for them is what they earned, and for you is what you earned. And you will not be questioned about what they used to do."  

الطبراني:١٧٠حَدَّثَنَا مُحَمَّدُ بْنُ إِدْرِيسَ بْنِ عَاصِمٍ الْجَمَّالُ الْبَغْدَادِيُّ ثنا إِسْحَاقُ بْنُ رَاهَوَيْهِ أنا يَعْلَى بْنُ عُبَيْدٍ عَنِ الْأَعْمَشِ عَنْ أَبِي رَاشِدٍ قَالَ جَاءَ رِجَالٌ مِنْ أَهْلِ الْبَصْرَةِ إِلَى عُبَيْدِ بْنِ عُمَيْرٍ فَقَالُوا إِنَّ إِخْوَانَكَ مِنْ أَهْلِ الْبَصْرَةِ يَسْأَلُونَكَ عَنْ عَلِيٍّ وَعُثْمَانَ ؓ فَقَالَ

«وَمَا أَقْدَمَكُمْ شَيْءٌ غَيْرُ هَذَا؟» قَالُوا نَعَمْ قَالَ {تِلْكَ أُمَّةٌ قَدْ خَلَتْ لَهَا مَا كَسَبَتْ وَلَكُمْ مَا كَسَبْتُمْ وَلَا تُسْأَلُونَ عَمَّا كَانُوا يَعْمَلُونَ}