Plus JFK took responsibility for the Bay of Pigs mess.
The invasion plan was largely Kennedy's. He was intrigued by limited military strikes or operations.
"I am sure that the green beret will be a mark of distinction in the trying times ahead."
-- John F. Kennedy, memo Oct 12 1961
According to author Irwin F. Gellman, Eisenhower never planned an amphibious assault on Cuba. ( See: "It’s Time to Stop Saying that JFK Inherited the Bay of Pigs Operation from Ike"
Link )
He knew beforehand that it had a very low probability of succeeding. His generals told him so. Plus he was a war vet himself.
Kennedy moved the invasion site to the more rural setting of the Bay of Pigs, not knowing the reefs were coral. The local militia was underestimated.
He must have known it was a stupid idea to send 1200 men to fight an army of 200,000 Castro solders.
The idea was to establish a beachhead and fly in a provisional government to declare themselves the rightful government. Then the US would be formally invited to assist them to oust Castro.
The US also seemed to think the local populace would rise up. But most Cubans thought they were better off under Castro than the US-sponsored Bastista. Poor people were getting equal access to healthcare and education. The US didn't want that in their country.