So I was doing this one problem in which there is a sphere of radius r and charge density row and there is a spherical cavity inside it whose center is at a distance r2 from the center of the bigger sphere. Now the question was what is the E field inside the cavity. My first and long thought was that there is no charge inside this cavity, so I will draw a gaussian surface inside this cavity and notice that flux is 0 and say E is 0. After getting the wrong answer, and discussing with some friends , they said to consider superposition of a sphere of charge density -row and then find E and I got the right answer but then why does Gauss law fail in giving me the right result? This might be very elementary but I have just started.