The Messenger of Allah ﷺ said, "Whenever a Muslim man declares another Muslim man to be a disbeliever, if the accused is indeed a disbeliever, the charge stands. Otherwise, the accuser himself becomes the disbeliever."
قال رسول الله ﷺ: أيما رجل مسلم أكفر رجلا مسلما، فإن كان كافرا، وإلا كان هو الكافر.
Abu Dawud (4687) reported it from Uthman bin Abu Shayba, who said, "Jareer narrated to us from Fudayl bin Ghazwan, from Nafi, from Ibn Umar," and he related the hadith. Its chain of transmission is sahih.On this subject there is also a report from Abu Saeed, who said, the Messenger of Allah ﷺ said, "No man ever accuses another of disbelief without one of the two of them bearing the consequence of it, if he was indeed a disbeliever, and otherwise the one who made the accusation is the one who falls into disbelief because of it." Ibn Hibban reported it in his Sahih (248) from Hasan bin Sufyan, who said, "Hasan bin Umar bin Shaqiq narrated to us, saying, 'Salama bin Fadl narrated to us from Ibn Ishaq, from Asim bin Umar bin Qatada, from Mahmud bin Labeed, from Abu Saeed,'" and he related the hadith.Ibn Ishaq is a mudallis and he narrated here using an ambiguous form of transmission, and I have not come across any explicit statement from him confirming direct transmission.