In my view the problems facing the Soviet space program at the time were just too systemic for even Korolev to have resolved. Unlike the US which had NASA and thus a single coordinated moon program, the Soviets essentially had 3. Korolev, Yangel and Chelomei were constantly fighting each other for political influence and funding. Even then, the funding never matched the grandiose political statements (similar to NASA today). While Sputnik, Vostok and Voshod could be accomplished on a shoestring budget, leveraging the R-7 program, the Soyuz, N1 and LK (the Soviet Lunar Lander) programs required substantial investment that never really emerged. Korolev was never able to build a test stand for the N-1 due to lack of funding, meaning they had to "debug" it in flight, an insane approach for something as large, complex (and expensive) as the N-1. In 1966, Korolev spent the entire annual N-1 budget by March and wasn't able to do anything more until the next year. The under investment in Soyuz resulted in Komarov's death on a spacecraft no where near ready to carry a crew. The first unmanned flight of the LK didn't even take place until the end of 1970.
It's interesting to note that the slashing of NASA's budget began in 1967, shortly after the CIA released its intelligence estimate on the state of the Soviet Space Program. While they indicated a manned flyby by 1968 was likely, a manned landing wasn't likely until 1972 if at all.