The Messenger of Allah ﷺ said, "Whoever falsely swears by a religion other than Islam is as he has described himself."
حدثنا أحمد بن منيع حدثنا إسحق بن يوسف الأزرق عن هشام الدستوائي عن يحيى بن أبي كثير عن أبي قلابة
قال رسول الله ﷺ من حلف بملة غير الإسلام كاذبا فهو كما قال
Agreed upon [by Bukhari and Muslim]. Muslim also recorded it in the book of Iman, chapter on the severity of the prohibition against a person killing himself, etc., hadith no. 176/110, from the hadith of Hisham Dastawai. Bukhari recorded it, hadith no. 6047, from the hadith of Yahya bin Abu Kathir with the same chain. See also hadith no. 1527.