From Sahih Muslim (Hadith 6626):
Jabir b. Abdullah reported Allah's Messenger (ﷺ) as saying:I am a human being and I have made this term with my Lord, the Exalted and Glorious: For any servant amongst Muslims whom I curse or scold, make that a source of purity and reward. This hadith has been narrated on the authority of Ibn Juraij with the same chain of transmitters
Reference: Muslim 6626