A narration similar to this is also reported from Sayyiduna Jabir (may Allah be pleased with him), but in it there is «زكاة و رحمة», that is, "Make my cursing and praising for them a means of purification and mercy."
Hadith Takhrijاس حدیث کی سند صحیح ہے۔ دیکھئے: [مسلم 2602] ، [أبويعلی 2271] ، [ابن أبى شيبه 9601]
Brief Explanation
(Commentary on Hadiths 2799 to 2801)
The Messenger of Allah (sallallahu alayhi wa sallam) never cursed any believer throughout his entire life; he said this out of humility, that if, due to human nature, such an act had occurred, then may Allah, the Exalted, make it a mercy, a blessing, and a means of nearness for that Muslim.
From this, the human nature (bashariyyah) of the Prophet (sallallahu alayhi wa sallam) is established, and also that every human being can make mistakes due to being human.
This supplication of the Prophet (sallallahu alayhi wa sallam) is only for Muslims, not for disbelievers.