That’s the next bit for Simon if when he removes it from the mounting and it does not change heading, take the cover off the fluxgate compass and have a look inside. The fluxgate compass assemble is not that complex and if something is wrong with it you can generally see it pretty quickly.
Well done on sorting yours out. Yours was the lead weight, mine was ferrous screws used to mount it. I always find that fault finding on a boat we always default to DEFCON 1 and assume the worst (most expensive), but I’ve learnt over 15 years of sailing to eliminate the simple stuff first, its cheaper