From Gauss's law of gravity reduced to 2 dimensions, one can easily show that the gravitational force follows an inverse law, i.e. $$ \mathbf{F}(\mathbf{r}) =- \frac{G m M}{|\mathbf{r}|}\hat{\mathbf{r}}. $$ Similarly, one can derive that the gravitational potential $V$ at a distance $r$ from a point mass of mass $M$ reads $$ V(r) = G M \log(r). $$
However, the physical interpretation that the gravitational potential can be defined as the work that needs to be done by an external agent to bring a unit mass from infinity to the distance $r$ from a point mass $M$ now fails since $$ V(r) = -\frac{1}{m}\int_{\mathbf{\varphi}} \mathbf{F} \cdot \mathrm{d}\mathbf{s} = \int_{\infty}^{r} \frac{GM}{r'} \mathrm{d}r' = GM \left[ \log r' \right]_{r' = \infty}^{r} = \infty. $$ Is there a way to reconcile this? Or is it fundamentally wrong to try to reduce Newton's gravity (or similarly, Gauss's law of electrostatics) to 2 dimensions?
This question is different from What is the 2D gravity potential? where it is explained why the gravitational force follows an inverse law in 2D (instead of inverse square law known from 3D) but the work done by the gravitational force field "from infinity" is not discussed.