At $r = \infty$, the gravitational potential energy of an object due to Earth’s gravitational field is at a maximum value of $0$. I understood this to mean that an object will have maximum potential energy at a distance infinity away from the Earth’s core. This seems to make sense, as the higher you lift an object, the more potential energy it has.
But we also know that $ F= \frac{GMm}{r^2}$, so when $r=\infty$, $F=0 $. So how can an object have maximum potential energy when the Earth is exerting $0$ attractive force on it?