The Messenger of Allah ﷺ related that a man said, "By Allah, Allah will not forgive so-and-so."Allah the Exalted then said, "Who is this who swears by Me that I will not forgive so-and-so? Indeed, I have forgiven so-and-so and rendered your deeds void," or as he said.
أن رسول الله ﷺ حدث أن رجلا قال: والله لا يغفر الله لفلان، وإن الله تعالى قال: من ذا الذي يتألى علي أن لا أغفر لفلان، فإني قد غفرت لفلان، وأحبطت عملك أو كما قال.
Muslim reported it in the Book of Righteousness and Kinship Ties (2621:137), from Suwayd bin Saeed, from Mutamir bin Sulayman, from his father, who said, Abu Imran Jawni narrated to us, from Jundab, who said, then he related it.His saying, "yatalla," means he swears, and the "aliyyah" is an oath.