In a real and ideal situation, those who criticize government are suppose to be those allowed to show what they have to offer because it may seem that they have better idea. I said ideal because assuming the system is not corrupt, so that they can genuinely offer something positive to growth of the country but the problem is when such person get into power or government and meet bad system, they eat their words and start doing the same thing that they have criticized or they are frustrated out of the system by those who are feeding from the corrupt system.
A vast majority of the problem lies in the system and just like you have said the action of the leader is mostly controlled by the system on the ground and most problems that we think are leadership problems are actually system problems and to start with, any country that you see it government losing legitimacy from the citizens such countries have one thing in common which are faulty constitutions weak institutions.
More also a lack of national developmental goals, all of which is what gave room to bad leadership since the system could be bastardized at will.