It very much does not in most tunnels with rebar, highways with rebar, bridges, or downtown environments with massive steel buildings. Or areas with iron deposits. Even airplanes have to be careful in flight near some areas of known magnetic disturbance (which are marked on maps).
I've designed magnetometers for airplanes professionally and it takes very little to throw them off, and dead reckoning with them even in the sky is very difficult (I know, this is me indicating my "opinion matters more than anyone else's"....). Airports have specific areas built to check compasses that don't have rebar in the surface.
Almost all systems that navigate during GPS denied times use accelerometers and gyros to dead reckon, not magnetometers. These all suffer from drift that limits the amount of time it can be used, and does not assist when you have parked in a parking garage for 8 hours, pull out into an urban canyon with massive multipath, and want to use AP to get home. They are useful for short tunnels, but even in that distance easily drift off 100+ feet, and Tesla's FSD relies on position more accurate than that.
And of course- it appears Teslas have a gyro/accelerometer (shared with stability control), but I don't think anyone has ever found a magnetometer in one.
But seriously- we're all cool with Tesla's "FSD" software being dangerous to use outside the USA, but them not having geofenced in the code at all? Why do we keep needing the user to obey Tesla's restrictions like USA only or no autosteer on city streets instead of their own code enforcing it?
I mean, the last time we discussed FSD and safety, this is what we had to say. So using FSD anywhere can't be unsafe (with or without GPS), right?