Castro came to power in Cuba in 1959 when Eisenhower was President. Whether a more competent US President than JFK could have freed Cuba from his dictatorship is something we will never know.
John pulled their support when (actually probably because) they were winning.
And after that Castro took over the whole shooting match thanks to his good friend in the white house.