I've made at least two long and involved posts about our experience with the identical problem. If you can't find them - I can send them to you. We experienced the same symptoms three, or maybe four times since 1995.
Our problem was a failed or (worse) intermittent connection to the fluxgate
compass. Each time the compass re-connected it would send a new, and usually different, heading value. The ST6000 would then try to steer based on the new, and erroneous, heading info.
One wire failed inside the Fluxgate
and the other failed between the Fluxgate and the ST6000.
Eventually, after 18-years, the ST6000 course computer itself started failing with some similar symptoms. I had a local Raymarine
tech work on it but it just kept failing at odd intervals.
I replaced the whole system in spring 2013.