I checked the website for a similar problem but although there are other questions with a similar title, I couldn't find any question which directly deals with my problem. This question might be trivial but for some reason I have difficulty understanding it.
Imagine a uniformly charged ring. A picture is given below for clarity. We want to find the electric field in an arbitrary point inside the circular ring (point $P$). The primed coordinates are source coordinates and the others are field coordinates. Just to make it clear, I am not talking about analyzing a 3D object in a 2D plane. Imagine the whole universe is 2D and we want to solve this electrostatics problem in that universe.
Based on symmetry it is clear that the field must be along the radial direction. Using Coulomb's law we can integrate over the contributions of infinitesimal elements. Assume that the charge density is $\lambda$ and it is positive and $r'=R$ is the radius of the ring. This problem is actually solved here, and the answer is:
$E = \frac{\lambda}{4\pi \epsilon_0 R}\int_0^{2\pi} \frac{cos\theta'-a}{(1+a^2-2acos\theta')^{3/2}} d\theta'$
Here, $a=\frac{r}{R}$ and the results for the numerical solution of the integral is given in the linked video. Alternatively, applying Gauss' law for an arbitrary Gaussian surface containing $P$ (not necessarily close to the boundary of the surface) gives:
$\oint E.da = \frac{Q_{enc}}{\epsilon_0} \rightarrow E=0$
Here, we have assumed that the electric field is uniform inside the Gaussian surface (the red circle) and this assumption is wrong, therefore the result is not reliable. Some people (for example here) claim that this is the correct result but I don't think it is, because as I showed, direct calculation using Coulomb's law gives a different result.
As a workaround, we can look at a Gaussian surface very very close to the point we are interested in (make the red circle smaller so the point $P$ is very close to it's surface). Doing so, we don't need to assume that the field is uniform in order to take the surface integral. As stated before, due to symmetry the electric field will be along the radial direction (which is perpendicular to the Gaussian surface and makes the calculation of the integral the same as before) and all points with the radius $r$ from the origin will have an electric field of same magnitude along their respective radial directions.
The result for the electric field is again zero which doesn't agree with the initial result. Moreover, since the direction of the field along all the points just below the surface is the same, I can't understand how do we get zero as the result of the integral. If all the arrows are pointing to either inside or outside the surface (depending on the sign of the charge) due to the symmetry, how can we have a zero flux?!
Since the Gauss law is fundamental I must be applying it wrong or I am assuming a symmetry that isn't there. What am I doing wrong?
There are other problems with different geometries that I have a similar problem with. For instance, the first part of the problem 4 in this document (PhD qualifying exam in Yale) solutions to which is available here, deals with the electric field due to a rotating, uniformly charged and infinitely long cylinder. The cylinder is made up of infinite number of rings with non-vanishing radial fields (as explained earlier). As you can see in the solutions document, using Gauss law as I did in my problem, they conclude that the field inside the cylinder is zero.