By the end of the 1968 classic, we see that
the astronauts are in fact on Earth, and not on the planet 3000 light years away in another galaxy as it was intended.
How are they there? Why didn't they land where they were supposed to land?
In Planet of the Apes it all happens while Taylor is in stasis and he only awakes as the spacecraft is crashing.
In the immediate sequel, Beneath the Planet of the Apes there is reference to a
a Haslein Curve, a bend in time.
and the script for that movie has a proposed narration which refers a...
"fold in the Fourth Dimension"
...but I'm not sure this actually made it into the movie.
Quite how a time-jump translates to a spacial jump is not covered.
One assumes that whatever caused the time-jump, be it a wormhole or something else, also sent the astronauts who were on their outbound trajectory away from Earth back to where they came from...at least spacially if not temporaly.