[edit: as predicted, there is a counterexample with no continuous loop. See addition below.]
I think that you may not quite get a loop, only a topological continuum (a compact connected subset) on the sphere whose complement contains multiple components. The continuum can be gotten by elaborating Rahul's answer to choose a suitable component of the $g=0$ locus.
The existence of topologically wild continua such as the "Warsaw circle" suggests that you can draw such a creature on the sphere or projective plane and then extend to a continuous function that would give a counterexample. Or you could take a field that has the equator as the locus of isothermal antipodes ($g=0$) and try to perform a (antisymmetric) bending construction that modifies parts of the equator, turning it into a wild curve that cannot be traced by a continuous loop.
[added: the extension construction would work as follows. Take two opposite points on the equator. Join them with a wild continuum in one hemisphere, and the antipode of that continuum in the opposite hemisphere. Define $f(x)$ to be the distance to the wild thing, in one hemisphere, and the negative of distance to the wild thing, in the opposite hemisphere. Hence $f(x) = -f(-x)$ on the whole sphere, and $f=0$ only on the wild construction that cannot be traversed continuously by a path.]