No failure *may* make JFK feel bold enough to try and invade the island outright when they discover the missiles, but i'm doubtful about that.
If anything, the failure of the Bay of Pigs was an
encouraging factor to invade Cuba. Many high-ranking figures in the political and military leadership of the time wanted revenge against Castro and saw an invasion of Cuba as the best way to rectify the failure of April 1961. Without the Bay of Pigs embarrassment there would be less of an itch to attack Cuba.
That said, before the Bay of Pigs JFK was very easily bossed around by the military brass no matter if their views/proposals were wrong. He didn't think the Bay of Pigs was a very good idea, but went along with it anyway in part because the Joint Chiefs told him to. After the Bay of Pigs he was more willing to exercise independence as a leader and say no when he had to. The missile crisis was one of those times. Without the Bay of Pigs, JFK would be more likely to listen to the Joint Chiefs who were telling him to invade Cuba and risk nuclear war. Obviously MAD would still be a big factor in his decision making, and nuclear destruction is a very different circumstance than a small band of exiles making an expedition to Cuba. So invasion still wouldn't be JFK's first response but he'd be more willing to exercise it.
In hindsight, the failure of the Bay of Pigs probably helped Kennedy. It made him a more mature and bold leader and prepared him for the intensity of the Cuban Missile Crisis. He became more cautious when taking military action, and made sure to listen to a variety of opinions and weight a variety of options before making an important decision.