Abu Hurairah (RA) reported that he heard Allah's Messenger (ﷺ) as saying: O Allah, for any believing servant whom I curse make that as a source of nearness to Thee on the Day of Resurrection.
Hadith Referenceصحيح مسلم / كتاب البر والصلة والآداب / 2601