First before you do anything else (and some posts above have touched on it), make sure that when you compare the GPS to a steering compass (binnacle) that you are motoring in slack water with no known currents. Else the GPS is not providing course, it's providing direction and that is a totally different thing.
Secondly, if your auto pilot still holds a course even with the compass reading being way off then the fluxgate is probably OK. If the fluxgate is dodgey the auto pilot will not hold a course.
Thirdly, if the fluxgate appears to be dodgy (won't hold a course), check it's location. If it is anywhere near the engine, move it because the engine's magnetic field changes every time you run it. Also check that you haven't got stuff (belt buckles, binoculars, etc.) in lockers near the fluxgate that are moving and causing a change in local magnetic field.
If the auto pilot holds a decent course, find the calibration instructions for your auto pilot and reset the fluxgate. Driving round in circles is not going to cut it.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
"Two possibilities exist: Either we are alone in the Universe or we are not. Both are equally terrifying."
Arthur C. Clarke