If I use Gauss' theorem I find that, for $r\geq R$
$$V(r) = \frac{\sigma R^2}{\epsilon_0 r} = \frac{Q_{sphere}}{4\pi\epsilon_0r}$$
where $\sigma$ is the surface charge density and $R$ the radius of the sphere.
But if I use the "direct" formula, I find that
$$V(r) = \frac{1}{4\pi\epsilon_0}\iint_{sphere}\frac{\sigma(P)}{||\vec{PM}||}dS$$
with $P\in sphere$
and since the sphere is uniformly charged and $||\vec{PM}|| = |r-R|$
$$V(r) = \frac{\sigma}{4\pi\epsilon_0|r-R|}\iint_{sphere}dS = \frac{Q_{sphere}}{4\pi\epsilon_0|r-R|}$$
What am I doing wrong ?