Loss of pitch control during turn because pitch rate from gyro is incorrect

During a turn my craft loses pitch control because the pitch rate from the gyro is incorrect. In the plots below it can be seen that there is about half a second where the pitch decreases despite the pitch rate remaining positive the entire time. I figured out that if I multiplied the yaw rate by the sine of the roll angle then this pretty much accounts for the offset in the pitch rate from the gyro. Pitch responds perfectly fine when there is no roll. I would assume that corrections between the earth and body frames would be accounted for in the arduplane code but it seems like that is not the case at the moment for me. I’m pretty new to arduplane so I was just wondering if there is a setting that I have turned off.