It's quite simple. JFK wanted to stabilize and normalize relations with Cuba and the USSR and withdraw from Viet Nam. He made this clear in October by issuing NSAM 263 which directed the withdrawal of 1,000 American troops from Viet Nam by the end of 1963 and of the bulk of US forces by the end of 1965. Before the orders of the President could be carried out, he was shot through the head, the Johnson administration took the Gulf of Tonkin incident from the How to create a Casus Belli for Dummies book and the rest is history.
People pretend that November 22, 1963 was nothing more than a smooth transition of power and policy didn't change. It wasn't and it did. And not for the better.
Sorry, it's more complicated then your explanation. JFK's supposed desire to "stabilize" relations was meaningless if the Soviets and Castro and North Vietnamese didn't want to do so as well. They had a vote on the matter; it wasn't simply up to JFK's wishes. He certainly wanted to avoid a confrontation with Moscow; he showed that during the missile crisis. But avoiding war is different then making peace, especially with an opponent that showed little if any interest in it.
In Vietnam, after Diem's overthrow (which, as noted in the original post, JFK approved of), the North stepped up its attacks on the South and at the same time the South couldn't put together a stable government that was capable of defending itself. It was the worst of both worlds. This was the situation LBJ inherited and one that JFK would have likely had to face.
In 1964 Khrushchev was overthrow by hardliners in the Politburo who were upset at his policies. They in turn took a harder line against the US, especially in Vietnam.
And in Cuba, LBJ ended almost all of the covert war on Cuba that the Kennedys put into place. JFK and RFK, in my view, didn't want to "stabilize" relations with Castro; they wanted Castro removed from power. And Castro didn't want to normalize relations with the US; he showed that for the entirety of his rule of the island.
As to the troop withdrawal from Vietnam: The withdrawal was always contingent on the ability of the South to take on the war at the same time. There was never a consideration at that time to simply leave. Read the first section of NSAM 263; that explains what the objective was. And it wasn't just to leave.
RFK himself said this in 1964:
Question: "There was never any consideration given to pulling out?"
Kennedy: "No."
Yes, there was no desire to go "all in" either; not at that time.
If you read McNamara's books on the issue he too said there was never a discussion of simply leaving. The idea was to help the South defend itself; not simply to cut and run. And the projected withdrawal of most troops by 1965 was overtaken by other events. Events that JFK and then LBJ had to face.
Again, JFK may have wanted normal relations with the communist world; the problem was that the other side had to agree with his wishes.