Don't rule out the obvious answers...

If your autopilot won’t keep a steady course, check for metal objects placed near the fluxgate compass. It may sound obvious, but this PBO writer once spent hours wondering why the boat performed a 90 degree turn when the heads door was opened. The bin bag on the back of the door held the answer… a tin can!