Why do we take account of the whole solid sphere when calculating potential energy of a point inside a solid sphere? See I know that Newton's shell theorem says that any point inside a spherical shell does not encounter any gravitational force by the (outer)shell and it is zero. The same principle we use while finding the weight of a body deep inside Earth. But when calculating the potential of a point inside a solid sphere we always account for the potential due to the outer shells as well. Why is that?
 A: The shell theorem relies on the fact that force is a vector, and so the vector sum of forces cancels out inside each shell.
Potential energy is a scalar, and more importantly it is the same sign for all contributions from a given shell. Therefore, the potential energy does not cancel out for each shell and must be considered.
A: So, you are applying the principle of superposition in general. And you could apply it in the way that you want to apply it, too! But it would trade off an easier calculation of the potential at the point, for a harder calculation of the potential off at infinity.
Just to be clear, the potential of a spherical shell of radius $R$ looks something like this: $$V_R(r)=\begin{cases}
V_0,&r<R\\
V_0\frac{R}{r},&r\ge R
\end{cases}$$so there is a constant part up until the radius of the shell, and then there is a $1/r$ potential that goes to zero at infinity. Meanwhile the charge is wrapped up in the exact shape of $V_0$ as a function of some surface charge $\sigma$ and $R$ itself, which, let’s not get into here...
It is important to realize that you can add an arbitrary constant to this potential. You can set the zero point to be whatever you want. This becomes especially important when doing calculations where the potential is logarithmic as you go to Infinity rather than $1/r$ and you often want to just choose one surface that all of these potentials will be at zero at, because when you sum a lot of these potentials together you are sending a lot of zeros together on that surface, and the result will be that that surface is where the potential of the sum is zero.
But here we have chosen the convention that the place where the potential will be zero is off at infinity. And that directly causes your problem, we are summing a bunch of values from shells that are outside the current shell, because they have these non-zero $V_0$s that we have to account for.
But, what you can do, is to use not $V_R(r)$ but $V_R(r)-V_0.$ This uses the arbitrary constants that you can add to potential functions, to enforce a different boundary condition: that $V(0)=0.$ Suddenly, you get for free that your integral for the potential only depends on enclosed charge and not on external charge! Yay! But what was the cost? The cost is that now the potential at infinity is nonzero, and you must calculate what it is—the dependence outside the radius of the ball doesn't decay to zero like $V_{\text{ball}}(R_{\text{ball}})~\frac{R_{\text{ball}}}{r}$, but instead it decays like $1/r$ to some unknown constant, which is the negative of the potential that you would have calculated to be the potential of $r=0$ the more conventional way.
There's nothing wrong with either approach, do whichever one suits you better.
