Mechanical compasses of that sort are more complicated, at least because you need a vertical reference and a gimbal with 2 degrees of freedom.
Also, that's not very accurate if you don't know your longitude: the isolines of vertical strength are amusingly curvy: https://upload.wikimedia.org/wikipedia/commons/4/4c/World_Magnetic_Inclination_2020.pdf
BTW I wonder how many sports trackers use the magnetic field to simplify their motion tracking, and then work very differently sufficiently far north or sufficiently close to the equator. (E.g. for breaststroke in swimming pools oriented east-west in Switzerland keeping a running average of the magnetic field direction at wrist is a more reliable way of counting lengths than what Garmin was doing up until something like 1-2 years ago)
People use (I don't know how successfully) gravimetric anomalies to supplement inertial navigation underwater (in a similar mode to those early car navigation systems that could never locate you, but would use their knowledge of how the roads look like to correct dead reckoning). I wonder if this could be used in a similar way.
@robryk you would need a map of the magnetic fields, a high accurate sensor, and you'd not even approach GPS level accuracy.. but its doable in theory yea.