The Messenger of Allah ﷺ said, "Whoever separates from the community by even a hand's span has removed the yoke of Islam from his neck."
حدثنا أحمد بن يونس حدثنا زهير وأبو بكر بن عياش ومندل عن مطرف عن أبي جهم عن خالد بن وهبان
قال رسول الله ﷺ من فارق الجماعة شبرا فقد خلع ربقة الإسلام من عنقه
[Hasan] Ahmad narrated it: 5/180, from the hadith of Zuhayr, with this wording. Ibn Abu Asim also narrated it in Sunnah, no. 1053, with a sahih chain from Zuhayr, with the wording, "Whoever separates from the community and Islam has cast off the noose of Islam from his neck."