For finding electric potential energy of a uniformly charged sphere, we can assemble the sphere by brining charges from infinity to that point. So to make a uniformly charged sphere of radius $R$ and total charge $Q$, at some instant, charge will be assembled up to a certain radius $x$. In order to find potential of this sphere at the surface, why is my approach giving different answers?
Approach 1:
$$\rho = \frac{3Q}{4 \pi R^{3}}$$
$$q = \frac{4}{3} \pi x^{3} \rho = Q \frac{x^{3}}{R^3}$$ Potential at the surface would be $$V = \frac{q}{4 \pi \epsilon_0 x} = \frac{Q x^{2}}{4 \pi \epsilon_0 R^{3}}$$
Approach 2: $$\rho = \frac{3Q}{4 \pi R^{3}}$$ $$q = \frac{4}{3} \pi x^{3} \rho = Q \frac{x^{3}}{R^3}$$ $$E = \frac{Q x}{4 \pi \epsilon_0 R^{3}}$$ (From Gauss' Law)
Potential at the surface would be $$V = -\int{\vec{E} \cdot \vec{dx}} = -\frac{Q}{4 \pi \epsilon_0 R^{3}} \int_{0}^{x}{xdx} = -\frac{Q x^{2}}{8 \pi \epsilon_0 R^{3}}$$
Why is the answer different in both the cases?