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:26:207

They would not be availed by the enjoyment with which they were provided.  

in what way (mā here is interrogative) would that enjoyment which they were given avail them?, in averting the chastisement or mitigating it? It would be of no avail!
القرآن:٢٦:٢٠٧

مَا أَغْنَىٰ عَنْهُمْ مَا كَانُوا يُمَتَّعُونَ  

{ما} إستفهامية بمعنى: أي شيء {أغنى عنهم ما كانوا يمتعون} في دفع العذاب أو تخفيفه أي: لم يغن.

See similar narrations below:

Collected by Qurʾān
quran:15:84

So nothing availed them ˹from˺ what they used to earn.  

And so that which they used to count as gain, in the way of building fortresses and amassing riches, did not avail, ˹did not˺ protect, them, from the chastisement.
القرآن:١٥:٨٤

فَمَا أَغْنَىٰ عَنْهُمْ مَا كَانُوا يَكْسِبُونَ  

{فما أغنى} دفع {عنهم} العذاب {ما كانوا يكسبون} من بناء الحصون وجمع الأموال.
quran:111:2

His wealth will not avail him or that which he gained.  

His wealth will not avail him, nor what he has earned (wa-kasab means wa-kasbihi, that is to say, his sons; mā aghnā means ˹mā˺ yughnī).
القرآن:١١١:٢

مَا أَغْنَىٰ عَنْهُ مَالُهُ وَمَا كَسَبَ  

{ما أَغنى عنه ماله وما كسب} أي وكسبه، أي ولده ما أغنى بمعنى يغني.