To state the obvious: If anyone can code his way out of something it is someone who codes.
If enough people want something badly enough, when existing governing structures will bow is a question of how many people.
You should pretend your code isn't good enough. That way you can own the problem. You will get plenty of help from those making things worse. Empires crumble eventually.
This and your earlier comment presume that code is a way out. Much of the push-back here is that evidence is strongly suggesting that 1) it is not and 2) code tends in general to be a power-amplifier for those already in power. Put another way: your reform-minded hacker is not the only coder, and the opposition (or more accurately, the establishment) likely has far vaster resources.
The problem in your initial proposal comes in the first step: "Create a government from scratch". That is a political process at best; at worst, one predicated on violence (rebellion, insurrection, coercion).
Again, the solution is inherently political, not technical. There might be technical elements to such a political process, but those follow from rather than lead to.
This represents a significant shift in my own views over the past 20 years or so. In the 1990s I would have tended to agree with you. I no longer do.