Narrated from Ibn ʿAbbās and Anas, may Allāh be pleased with them, that they both discussed this verse:
﴾Perhaps those who disbelieve will wish that they were Muslims.﴿¹ They said:
“This is about [when] Allāh, the Exalted, gathers the sinners among the Muslims, and the polytheists; in Hell. So, the polytheists will then say [to sinners among the Muslims]:
‘Of what benefit to you is He Whom you used to worship?’
Then, Allāh will get angry on their [i.e the sinful believers’] behalf, and He will take them out by the grace of His mercy. And that is His statement, the Exalted:
﴾Perhaps those who disbelieve will wish that they were Muslims.﴿¹
Source: Az-Zuhd (1602) by Ibn Al-Mubārak | Culled By Shaykh ʿArafāt bn Ḥasan Al-Muḥammadī
1. Al-Ḥijr:2