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)
قَالَ رَسُولُ اللهِ ﷺ مَنْ حَلَفَ أَنَّهُ بَرِيءٌ مِنَ الْإِسْلَامِ فَإِنْ كَانَ كَاذِبًا فَهُوَ كَمَا قَالَ وَإِنْ كَانَ صَادِقًا فَلَنْ يَرْجِعَ إِلَى الْإِسْلَامِ سَالِمًا