As for criticizing leaders openly, then this comes out of the law of origin, that is, not in front of the public. Ulama such as Asy-Syaikh Muhammad bin Shalih Al-'Utsaimin gave details in the liqo' Maftuh answer questions with him, that if there is benefit in showing open denial of the ruler's policies then there is nothing wrong with openly denying the ruler's policies, namely the loss of evil and being replaced with goodness.
Details like this must be understood so that every scholar who denies the rulers in front of the audience does not arbitrarily sentence khawarij without inviting rebellion and is completely far from the 3 principles of khawarij above and is not provoking the ummah to rebel, then do the details!
Because such a haphazard verdict would have consequences for accusing many ulama, from An-Nawawi who slammed the door loudly in front of the leader, Ahmad bin Hambal who firmly voiced the evils of the leader's Aqidah, to shahabah 'Ubadah bin Shamit who openly denied a policy of Mu'awiyah , Ibn Mu'thy and Ahlul Madinah in the past etc.
Accusing other people of the khawarij in this case requires strong knowledge, not just reading the ushulus Sunnah and then going around accusing the khawarij. The Khawarij are the dogs of hell who were fought until their disbelief was disputed by ulama. As for the atsar that we find about people who insult the Amir, they are indeed originally from the khawarij who are based on the 3 principles of khawarij above.
Don't let the accusation be wrong, it turns out that the slander of Khawarij will later turn against the accuser in a situation where the accuser accuses of being reckless and unrepentant and withdraws his accusation, while Allah protects the accused from slandering of khawarij.
[Quoted from Al-Ustadz Al-Fadhil Abu Hanifah Jandriadi Yasin حفظه الله , translated by : Abu Maryam , source : https://m.facebook.com/story.php?story_fbid=665434810577167&id=100013319622062&mibextid=Nif5oz ]