That’s a story by Isaac Asimov called “The Billiard Ball”.
One of my favorites................
I wrote a story years (decades) ago that was published in a trash sci-fi pulp magazine (got $200!) about a guy who invented a time travel device but didn’t take into account the movement of the galaxy, the Sun, Earth etc and so ended up floating in space when he traveled back in time, and died.
I don’t remember the Asimov story, but I had to have been inspired by it, as I devoured his works.