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). (Using translation from Muslim 2621)
قَالَ رَسُولُ اللهِ ﷺ قَالَ رَجُلٌ وَاللهِ لَا يَغْفِرُ اللهُ لِفُلَانٍ فَقَالَ اللهُ ﷻ مَنْ ذَا الَّذِي يَتَأَلَّى عَلَيَّ أَنْ لَا أَغْفِرَ لِفُلَانٍ فَإِنِّي قَدْ غَفَرْتُ لِفُلَانٍ وَأَحْبَطْتُ عَمَلَكَ