The Prophet ﷺ said: If anyone takes an oath and says: I am free from Islam; now if he is a liar (in his oath), he will not return to Islam with soundness. (Using translation from Abū Dāʾūd 3258)
قَالَ رَسُولُ اللهِ ﷺ مَنْ حَلَفَ أَنَّهُ بَرِيءٌ مِنَ الْإِسْلَامِ فَإِنْ كَانَ صَادِقًا لَمْ يَرْجِعْ إِلَى الْإِسْلَامِ سَالِمًا وَإِنْ كَانَ كَاذِبًا فَهُوَ كَمَا قَالَ