The most likely rank of officer to stage a coup d’état is a colonel:
Colonel Reza Khan’s 1921 coup that brought the Pahlavi dynasty to power in Iran
The 1931 coup attempts by the Japanese Army (led by Lieutenant Colonel Kingoro Hashimoto)
The 1953/4 coup by Colonel Gamal Abdal Nasser which deposed King Faruk of Egypt
The 1967 coup by a group of colonels in Greece that established the military junta
The 1969 Libyan coup d’état in which Colonel Muammar Gaddafi took power
The recent successful coup in Mali this past June by Colonel Assimi Goita
The reason for this is that the generals interface with the politicians and the colonels interface directly with (and have the ability to have a relationship with) the troops.
While generals frequently are the chief executive officer of nations during peacetime (in the US these would include Washington, Jackson, Grant and Eisenhower), those who are in charge of the government are usually civilians.
We’ve heard of a Napoleonic complex and, while Napoleon was one of those rare instances when a country’s leader was also a military genius (joining the select group of King David, Julius Caesar, Genghis Khan, Charlemagne, Alexander the Great, Mao [who was a better military than a civilian leader] and only a handful of others), his complex seems to infect the most despotic of leaders - regardless of their competency at prosecuting a war.
These leaders state that they are smarter than their generals and have a tendency to take over control of the complexity of modern warfare without the requisite training or even aptitude. Recent examples of leaders who felt they were smarter than their generals (and who tended to make a mess out of military situations they became involved in) include such leaders as Hitler, Stalin, Trump (though only Iraq, Syria and Afghanistan were his bailiwick) and now Putin joins that group.
I believe that Putin is micro-managing the war in Ukraine because he feels he is smarter than his generals. From the beginning, things have not gone as he had planned and he has decided over the past week to simply take what he wants and then threaten Ukraine with the likelihood of his applying overwhelming force in the spring of 2023 once his 300,000 (or whatever) draftees are trained and armed.
Sure, on a man for man basis the Ukrainian army is better armed/trained and led, but I suspect they could not prevail without direct aid from NATO/US/EU/UK against an enemy who had simply decided to take the country by huge conventional force superiority. The saving grace is that, in Putin’s case, he is facing a number of very competent military leaders at the same time.