From Sahih Muslim (Hadith 4790):
It has been narrated on the authority of Ibn 'Abbas that the messenger of Allah (ﷺ) said:One who found in his Amir something which he disliked should hold his patience, for one who separated from the main body of the Muslims even to the extent of a handspan and then he died would die the death of one belonging to the days of Jahiliyya
Reference: Muslim 4790