Level Horizon Reversed

I am using a Pixhawk 4 on a fixed-wing airframe but we are having issues correcting the Level Horizon shown in QGC. During flight, we were able to control it manually by swapping the aileron controls from the RC transmitter but when we switched to other flight modes the plane flipped completely upside down. In ‘Flight View’ on QGC I can see that the artificial level horizon reading is inverted in the roll dimension (I should mention that in pitch it is still correct).

I have already tried recalibrated and rebooting the plane and enabling the PWM_AUX_REV1 parameters but none had an impact.

How can I correct the level horizon reading of the PixHawk 4?