Sahih Muslim 2621
Narration text is preserved in its supplied Arabic and English. Translated interfaces and reading guides do not add narration translations in other languages.
أَنَّ رَجُلاً قَالَ وَاللَّهِ لاَ يَغْفِرُ اللَّهُ لِفُلاَنٍ وَإِنَّ اللَّهَ تَعَالَى قَالَ مَنْ ذَا الَّذِي يَتَأَلَّى عَلَىَّ أَنْ لاَ أَغْفِرَ لِفُلاَنٍ فَإِنِّي قَدْ غَفَرْتُ لِفُلاَنٍ وَأَحْبَطْتُ عَمَلَكَ "
Jundub reported that Allah's Messenger (ﷺ) stated that a person said:
Allah would not forgive such and such (person). Thereupon Allah the Exalted and Glorious, said: Who is he who adjures about Me that I would not grant pardon to so and so; I have granted pardon to so and so and blotted out his deeds (who took an oath that I would not grant pardon to him).
Full reference and source
Sahih Muslim 2621 In-book : Book 45, Hadith 178 USC-MSA web (English) : Book 32, Hadith 6350 (deprecated)
View source on Sunnah.com (opens in a new tab)