It seems there is just a tiny piece of the story left out regarding Kennedy's popularity after the Bay of Pigs invasion.  My recollection was that Kennedy refused air cover for the invasion but the CIA went ahead anyway thinking that Kennedy would cave in after the invasion was initiated, but Kennedy did not cave in possibly averting a world war.  Popularity well-deserved in myopinion.  Perhaps the similarity here is the (attempted?) coup d'etat by the CIA in the time of Kennedy and the attempted coup d'etat on the Trump Presidency by the CIA today (i.e. Russiagate with no real evidence to date).