It doesn’t make sense unless Oswald was a schizo who didn’t know that JFK WAS keeping hands off Cuba and JFK DID give a big speech implying more cooperation with USSR to prevent future conflict was possible.
And Oswald must not have known that LBJ had a much more war hawk attitude towards USSR and Cuba than JFK.
I believe Oswald, like most Americans, assumed that LBJ was a bigger anti-communist Cold War hawk than JFK.
LBJ also was known to have previously supported segregation, something that Lee strongly opposed based on his writings and things he told people close to him. No one predicted that Johnson's Presidency would be as good for the Civil Rights movement as it became.
Civil Rights was one of the areas where Oswald approved of JFK's policies. Kennedy didn't live to see the 1964 Civil Rights Act passed but the groundwork for that legislation began being layed during his Presidency.
Also worth mentioning that AG Robert Kennedy hated Gen. Edwin Walker and tried to have him committed to a mental institution. Dislike of Gen. Walker is another point where Oswald agreed with Kennedy.