It has almost happened before.
A handful of wealthy families, including the Morgans, Chases, Du Ponts, and Johnsons, attempted a coup against FDR in the early 1930's as the Depression bottomed out, in order to ins ute fascism in the United States. Their allies had infiltrated the military, but the general they called upon to execute the coup blew the whistle on them.
The coup has thwarted, and the matter was referred to Congress. Of course, since rich and powerful people were responsible for the treason, Congress swept it all under the rug.