AltIMU-10 V5 Roll,pitch and yaw value problems

The symptoms you report suggest that you need to use a better calibration procedure for the magnetometer, but calibrating the accelerometer might also help. See this forum post