Yeah. Well, "gubmint" is a strange beast.
It seems quite obvious to me by now, that external factors and forces that are not "the elected government", often attach themselves to the levers of power of said government.
We try to protect against it, but the government is vast, it still happens.
I look at the JFK thing in terms of checks and balances, something along the lines of the exercise of a veto. You know... in Trump's case they just impeached him, maybe in JFK's case it was urgent and that wasn't possible. lol