Wrong compass data

I have APM 2.6 board. I noticed that with external magnetometer unplugged, MP shows direction(but “Bad compass health” error on HUD). When i rotate board - direction changes. When i plugging magnetometer in and calibrate it - it looks like inner and external magnetometers interferes. As result direction is wrong. So loiter mode becomes impossible. My quad flies away very quick in loiter mode. What did i do wrong?

@CrewDoo,
The APM2.6 does not have an internal compass and requires an external compass.
The fact that you get a “Bad Compass Health” message when you unplug the compass indicates that you have no internal compass.
Is your compass part of a GPS/compass module or is it a standalone compass module?
What compass orientation are you selecting when calibrating the compass?
Regards,
TCIII GM

Compass is a part of GPS module. Orientation ROLL 180. Where MP gets direction data with compass unplugged?

@CrewDoo,
It can get direction heading from the GPS when it has a lock and also from the IMU in the APM.
Regards,
TCIII GM

GPS has no lock. If MP gets IMU data for heading, why it mixes it with compass data?