The Messenger of Allah ﷺ said, "Whoever says, 'I am free of Islam,' if he is lying, then he is as he said, and if he is truthful, he will not return to Islam safe and sound."
حدثنا محمد بن إسمعيل بن سمرة حدثنا عمرو بن رافع البجلي حدثنا الفضل بن موسى عن الحسين بن واقد
قال رسول الله ﷺ من قال إني بريء من الإسلام فإن كان كاذبا فهو كما قال وإن كان صادقا لم يعد إلى الإسلام سالما
[Its isnad is hasan]. Abu Dawud narrated it in "Oaths and Vows," chapter on swearing by disavowal or by a religion other than Islam, hadith 3258, from the hadith of Husayn bin Waqid, with this wording. Hakim graded it sahih according to the criteria of the two Shaykhs, 4/298, and Dhahabi agreed with him.