I had this argument in my head, and now the most likely source of it, George Kenney and his Electric Politics podcast, has given me 102 pages of a 1998 law review article and an interview with its author, Carl T. Bogus, to lend it support.
Professor Bogus argues that there is strong reason to believe that, in significant part, James Madison drafted the Second Amendment to assure his constituents in Virginia, and the South generally, that Congress could not use its newly-acquired powers to indirectly undermine the slave system by disarming the militia, on which the South relied for slave control. His argument is based on a multiplicity of the historical evidence, including debates between James Madison and George Mason and Patrick Henry at the Constitutional Ratifying Convention in Richmond, Virginia in June 1788; the record from the First Congress; and the antecedent of the American right to bear arms provision in the English Declaration of Rights of 1688.
One way of reading the Constitutional debates of 1787 through the Federalist–Anti-Federalist exchanges, and finally to the Virginia Ratifying Convention of 1788 is to brace oneself for some of the most erudite philosophical discussions on politics ever compiled. It’s also a running debate with its own politics and personalities. Or, one can lift arguments from this newspaper editorial or that speech, and use that to interpret the whole. Bogus takes the first approach, and argues that gun control opponents, or insurrectionists, adopt the second.