the ruling is based on zahir. so long as a person explicitly or implicitly does not contradict any of the tenets of ahl al-sunnah, he/she remains a sunni. sitting with shady characters, keeping silent on their shenanigans or even promote them, praise of zanadiqah, not speaking up on major fitan and attacks on ahl al-sunnah and sunni aqayid are all serious lapses. but this does not mean a person doing these is out of ahl al-sunnah. that will happen ONLY if they contradict sunni aqayid. Allah taala knows best.