I think the clue here is in the distance apart the items are, suggesting its not magnetic!
You do not say what type of inverter you are using AC-DC (like a battery
charger), AC-DC (shore supply) or maybe DC-AC 220/110 or even a DC-DC converter. As many people use the word inverter for convertor or invertor.
The efficency and performance is proportional to the cost of these devices as to produce a nice clean ripple free output (AC or DC) requires the removal
of any variations produced in the conversion process. This does not mean a high price
is the best though.
If you have a Battery Charger
type device the output is often left a bit rough as it is relying on the battery to smooth the ripples (often good for wet cell type). Others chop the AC using thyristors into a rectified square wave DC but it often remains as a pulsed DC. This is cheap
as it does away with the cost of a transformer (used for many household plug
in AC-DC adaptors) and the capacitors for smoothing.
Then if its a DC-AC inverter, many produce a ramp
up of the voltage in pulsed steps to simulate the production of the sine wave which to look at is like a stairway over the hill and down the valley. If this is put through a transformer it can still be transferred to the output.
A pure smooth sine wave output (as is recommended by supliers of TV and electronics
gizmos) has so many steps and they are smoothed out before and after the transformer stages to produce a clean sine wave (or close to it).
So how does this help you all - well its the old story for every action there is an opposite reaction. If you are feeding, from your batteries, a pulsing device you will find a pulsing current
drain from the battery which is acting like an AC ripple on the DC supply and seen by all connected devices. Hold that thought.
If you are feeding to your battery with a rippling DC from the inverter / convertor and especially if the battery voltage is low, it will be seen and felt by every device connected, i.e. its the same as above.
, flux gate compass, etc. work by "sample - hold - display, sample - hold - display, sample - hold - display". otherwise how else would you be able to read them as you move along. Give them a rough and ripply DC and its like giving them AC, they are not designed for it. If the harmonics set up between the ripple and the sample hold dispay cycle fall right the sample point may end or start at the wrong time, the flux gate compass is a DC device put some AC in and those sensitive coils are going to do something dfferent.
How to rectify - feed the "GPS/Autopilot compass" (is that one or two devices?) with a separate 12V DC supply then switch on the inverter. If it behaves itself (them selves) then is probably a ripple. If the swing 10 degrees then back to the magnetic theory!