Abu Huraira 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.
حَدَّثَنِي حَرْمَلَةُ بْنُ يَحْيَى، أَخْبَرَنَا ابْنُ وَهْبٍ، أَخْبَرَنِي يُونُسُ، عَنِ ابْنِ شِهَابٍ، أَخْبَرَنِي سَعِيدُ بْنُ الْمُسَيَّبِ، عَنْ أَبِي هُرَيْرَةَ، أَنَّهُ سَمِعَ رَسُولَ اللَّهِ صلى الله عليه وسلم يَقُولُ " اللَّهُمَّ فَأَيُّمَا عَبْدٍ مُؤْمِنٍ سَبَبْتُهُ فَاجْعَلْ ذَلِكَ لَهُ قُرْبَةً إِلَيْكَ يَوْمَ الْقِيَامَةِ " .
Muslim
The Book of Virtue, Enjoining Good Manners, and Joining of the Ties of Kinship • Hadith 121