I am a 12th grade student from India. I was taught electrostatics before gravitation. I know that if in a uniformly charged sphere, a cavity is cut out unsymmetrically like towards an edge but still enclosed within the sphere, a non zero constant field would exist in the cavity. This doesn't violate Gauss's law as well. When a similar situation in gravitational, where a uniform mass density sphere has a cavity similar to the cavity above, a field does exist inside.
However, I know that gravitational field has only sinks and no sources. Field lines appear from infinity and end on an object having mass. Inside the cavity, since its enclosed, infinity doesn't exist inside there. Then how does a field line originate inside there? This wasn't a problem in electrostatics as positive charges act as sources and negative charges act as sinks for the electric field. Also charges can induce, and form the necessary negative or positive charge on the surface for the field, so we can consider the field line inside it as arising from a positive charge and ending at an induced negative charge. But I'm pretty sure masses cannot induce, correct me if I am wrong.
Please clarify my doubts. I am not very familiar with the General relativity and all that. My apologies if you face any difficulty in explaining to me.