What you say did happen, and it wasn't considered treason. Presser vs Ill., an important 2nd amendment case.
From wiki...
The indictment charged in substance that Presser, on September 24, 1879, in the county of Cook, in the State of Illinois, "did unlawfully belong to, and did parade and drill in the city of Chicago with an unauthorized body of men with arms, who had associated themselves together as a military company and organization, without having a license from the Governor, and not being a part of, or belonging to, 'the regular organized volunteer militia' of the State of Illinois, or the troops of the United States." A motion to quash the indictment was overruled. Presser then pleaded not guilty, and both parties having waived a jury the case was tried by the court, which found Presser guilty and sentenced him to pay a fine of $10.
Basically, Presser,
In December 1879, marched at the head of said company, about four hundred in number, in the streets of the city of Chicago, he riding on horseback and in command; that the company was armed with rifles and Presser with a cavalry sword; that the company had no license from the governor of Illinois to drill or parade as a part of the militia of the State, and was not a part of the regular organized militia of the State, nor a part of troops of the United States, and had no organization under the militia law of the United States.