Suppose $a>0$ and $S = \{(x,y,z) \in \mathbb R^3 : x^2+y^2+z^2=a^2\}$ then
MY FIRST APPROACH: $$\int\int\int\left(x^2+y^2+z^2\right)\mathbb dv=a^2\int\int\int \mathbb dv=a^2.\frac{4}{3}\pi a^3=\frac 4 3\pi a^5$$.
MY SECOND APPROACH:If i use spherical coordinate then $dV = r^2 \sin \theta dr d\theta d\phi.$ and $\left(x^2+y^2+z^2\right)=r^2$ now $$\int\int\int\left(x^2+y^2+z^2\right)\mathbb dv=\iint d\Omega \int_0^a (r^4) dr =\frac 4 5\pi a^5$$
where $\iint d\Omega = \int_0^\pi \sin(\theta)d\theta \int_0^{2\pi} d\phi = 4\pi.$
My question is that why such discrepancy in the answer$?$ and where did i commit mistake in my first approach.
(Note:2nd answer is correct but what's the problem with 1st$?$)

I think your mistake in first approach is that you take that as a line integral, whereas it is not: you can not put $\;x^2+y^2+z^2=a^2\;$ for the integrand, as this is a scalar function over the sphere $\;x^2+y^2+z^2=a^2\;$ , so you actually get (in spherical coordinates)
$$\iiint_S(x^2+y^2+z^2)dV=\int_0^a\int_0^{2\pi}\int_0^\pi\rho^4\sin\theta d\theta\,d\phi\,d\rho=$$
$$=\frac{a^5}5\cdot2\pi\int_0^\pi\sin\theta\,d\theta=\frac{4\pi a^5}5$$
which is basically the same as the second approach once one understands the first part...
The above is because in spherical coordinates we get $\;x^2+y^2+z^2=\rho^2\;$ , of course