The field g(r) is the slope of the potential V(r). A thin shell pulls nothing inside it — yet its potential is not zero; it sits flat at the surface value, so no work is done moving around within. A solid sphere pulls linearly toward the centre inside, and its potential dips to −3GM/2R at the core. Slide the probe through both and read the two curves.