The Messenger of Allah ﷺ said, "Whoever takes an oath saying, 'I am free from Islam,' if he is lying, then he is as he said, and if he is truthful, he will never return to Islam unharmed."
قال رسول الله ﷺ: من حلف فقال: إني برئ من الإسلام، فإن كان كاذبا فهو كما قال، وإن كان صادقا فلن يرجع إلى الإسلام سالما.
Reported by Abu Dawud (3258), Nasai (3772), Ibn Majah (2100), Ahmad (23006), and Bayhaqi (10/30), all of them through the route of Husayn bin Waqid, who said, Abdullah bin Burayda narrated to us, from his father, and he related it.Its isnad is hasan because of Husayn bin Waqid Marwazi, for his hadith is hasan.