I am thinking that rather than the compass, the control head may be getting interference when the alternator comes on.
Is there a major difference in how your wheel feels under power vs. sail as the wheel pilot my just be having trouble contolling the added helm pressure that may boats get under power.
Control heads are no longer available but Raymarine fixes them for about $200 bucks + shipping.
No longer posting. Reach me by PM!