Using your own analysis, the Second Amendment’s purpose is to preserve the existence of armed militias, not the private ownership of guns for any other purpose. It says nothing, ZERO, about any supposed right to mount an armed revolt against the government. Quite the opposite is the case.
If you read the Federalist Paper “On The Militia” you will see that the desire was to create militias under the control of the Federal government which the Congress could call up to repel invasions and quash insurrections — Article I, Section 8.
The purpose of the Second Amendment was not to enable an armed revolt against the central government. It was to provide militias that would be used by the Federal government to put down armed revolts, which is exactly what Washington did in 1794 when he put the militias of six states under federal control to put down the Whiskey Rebellion.