Whether you like it or not, the US lost in Vietnam, they lost in Afghanistan though I haven't kept up on Iraq, reading a few books about the topic showed me that the main impetus for leaving is that it is hopeless for the US to "win".
Edit: IF memory serves, this was the plan laid out by Bin Laden. The guy even put it on video and the stupid US government followed through. Unfortunately, web bitrot has made it difficult to find the relevant articles.
But it's worth noting that no victory was achieved by the insurgent forces that ever lasted in any of those places: the US, so long as it maintained the military will to stay, could bomb and destroy the insurgents indefinitely. It just couldn't tolerate the political cost of why it's people were being sent to die "over there", and a public which was and is dissatisified with foreign civilian casualties inflicted by US military missions.
I suppose the closest analogy is Syria but even there, there is so much proxy war going on that it's impossible to discern the reality of the situation.
Bottom line is that it is in the best interest of the political elite to avoid angering a non trivial portion of an armed population. There is no such restriction on a disarmed population.
You seem to be building a lot of assumptions into "the government is tyrannical but don't worry everyone will definitely support me when I start shooting at cops because that's how that works.