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:39:40

To whom will come a torment disgracing him and on whom will descend an enduring punishment."  

to whom (man, introduces the relative clause that is the direct object of ˹the action of˺ ‘knowing’) will come a chastisement that will disgrace him and on whom there will descend a lasting chastisement’, an everlasting one, namely, the chastisement of the Fire. Indeed God ˹then˺ disgraced them at Badr.
القرآن:٣٩:٤٠

مَنْ يَأْتِيهِ عَذَابٌ يُخْزِيهِ وَيَحِلُّ عَلَيْهِ عَذَابٌ مُقِيمٌ  

{من} موصولة مفعول العلم {يأتيه عذاب يخزيه ويحل} ينزل {عليه عذاب مقيم} دائم هو عذاب النار، وقد أخزاهم الله ببدر.

See similar narrations below:

Collected by Qurʾān
quran:11:39

And you are going to know who will get a punishment that will disgrace him ˹on earth˺ and upon whom will descend an enduring punishment ˹in the Hereafter˺."  

and you shall know to whom (man introduces the relative clause which constitutes the direct object of the ˹action of˺ ‘knowing’) will come a chastisement degrading him, and upon whom an enduring, an everlasting, chastisement will fall’.
القرآن:١١:٣٩

فَسَوْفَ تَعْلَمُونَ مَنْ يَأْتِيهِ عَذَابٌ يُخْزِيهِ وَيَحِلُّ عَلَيْهِ عَذَابٌ مُقِيمٌ  

{فسوف تعلمون من} موصولة مفعول العلم {يأتيه عذاب يخزيه ويحلّ} ينزل {عليه عذاب مقيم}.