Arming causes orientation issue

Has anyone seen this before? I have the plane level and the artificial horizon looks good. As soon as I arm, the AH yaws, rolls and pitches a large amount. I suspected a power surge or something so I disconnected all motors, servos and even the GPS and compass to see if it makes a difference. The position it switches to is different if you reboot the FC. Matek F765. I’m going to chalk it up to a damaged board. I have a new one coming

I have exactly the same issue on a Matek F405 Wing V2 but I found it’s related to the software version of arduplane.
I expierenced it with 4.5.4, went back to 4.4.4 and it was almost gone, 1 deg clockwise instead of 5-6 deg clockwise one arming.

Disarming does exactly the same movement counter clockwise and ends up at 0 again.

It has something to do with GSF because this behaviour turned up after I disabled my compass.