It is well known that the Laplacian of the gravitational potential $(V)$ is zero. One can easily show that by differentiating, as shown in the image.

But at the same time one can show via Poisson's Equation that Laplacian, $V = -4\pi G\rho$, where $\rho$ is the density at the point. Obviously if $\rho=0$ (For Example, outside the earth) this matches the result from the differentiation, but otherwise not. Where/why does this approach of differentiating fail?
The essential problem is that your differentiation is not valid at $r=0$.
So, $\Delta\frac{1}{r} = 0$ only when $r\neq 0$. At $r=0$ (which your integral is including), the differentiation is not valid.
If you search it up online, you will see that $\Delta\frac{1}{r} = 4\pi\delta(r)$, where $\delta(r)$ is the Dirac Delta 'function'.
(Disclaimer: It's not really a function (it's a distribution), but as you will only be using it inside an integral which contains the origin, it is safe to use it. Search it up.)
Now, the Dirac Delta function has the property that - $$\int f(\vec r)\delta(r)dV = f(0)$$ So, we get - \begin{align} \Delta V &= \Delta\int \frac{-G\rho}{r}dV \\ &= -G\rho\int \Delta\left(\frac{1}{r}\right)dV \\ &= -G\rho\int 4\pi\delta(r)dV \\ &= -4\pi G\rho \end{align}