I believe that it was his actions prior to the standoff that nearly caused nuclear war. He was a naive young senator who was suddenly thrust into the presidency (sound familiar?). He failed to act decisively during the Bay of Pigs invasion, which cost numerous lives of US supporters. Khrushchev knew he could be rolled. It was only luck, and a strong military (a legacy of Eisenhower) that prevented nuclear war.
You could be right.
However, it was Eisenhower that decided to use the CIA to overthrow Castro, and the CIA sucked up a lot of bad intel. Much of the intelligence received stated that if a CIA backed invasion occurred, the Cuban population would support it and back it up.
Just the opposite occurred.
In addition, Castro knew of the invasion before hand due Cubans the CIA was training in Florida, in addition, reports of a pending invasion were being broadcast within the US and foreign media sources.
Mistakes were made by Kennedy, the CIA and the Cubans we were training, however, the fact remains, all out nuclear war was avoided after the failed invasion, during the Cuban missile crisis.
Once again, the fact is these events were probably the most dangerous America and the world ever faced. The other fact is, nuclear war was avoided.
Looking back, I am confident most would consider avoiding a nuclear war as a good thing.
Another fact is, when you covertly go into foreign countries, with the motive of overthrowing their countries, you must be fully prepared for things to go southbound. It's a very risky business.