Quadcopter Continuously Spinning in Yaw Axis

I have recently moved to Ardupilot from Betaflight/ INav. I recently tried to test an X Frame F450 Quadcopter with Ardupilot. The Quadcopter was continuously spinning in the Yaw Axis, in other axes, it was very stable.

Auto Log Analysis
Log File C:\Users\hp\AppData\Local\Temp\tmp4A25.tmp.log
Size (kb) 3533.841796875
No of lines 43823
Duration 0:02:10
Vehicletype ArduCopter
Firmware Version V4.0.5
Firmware Hash 3f6b43e3
Hardware Type
Free Mem 0
Skipped Lines 0
Test: Autotune = UNKNOWN - No ATUN log data
Test: Brownout = GOOD -
Test: Compass = FAIL - Large change in mag_field (300.88%)
Max mag field length (1670.55) > recommended (550.00)

Test: Dupe Log Data = GOOD -
Test: Empty = GOOD -
Test: Event/Failsafe = FAIL - ERR found: FS_BATT
Test: GPS = GOOD -
Test: IMU Mismatch = GOOD - (Mismatch: 0.34, WARN: 0.75, FAIL: 1.50)
Test: Motor Balance = GOOD - Motor channel averages = [1300, 1308, 1295, 1349]
Average motor output = 1313
Difference between min and max motor averages = 54
Test: NaNs = FAIL - Found NaN in CTUN.TAlt
Found NaN in CTUN.DSAlt

Test: OpticalFlow = FAIL - FAIL: no optical flow data

Test: Parameters = FAIL - ‘MAG_ENABLE’ not found
Test: PM = GOOD -
Test: Pitch/Roll = UNKNOWN - ‘BarAlt’
Test: Thrust = GOOD -
Test: VCC = UNKNOWN - No CURR log data

I have also uploaded the Flight Logs here- https://drive.google.com/file/d/1KPFudQ7eQdzuMOlSdfwVVneQxyKIj4ss/view?usp=sharing

I have a few Question related to the same-

  1. Does it seem like a Calibration Error? I have tried to recalibrate the compass a few times and have also tried to change locations.

  2. Is there some sensor gone wrong in the Flight Controller or GPS?

Thank You

Don’t bother with Auto Analysis it’s not up to date. The Yaw is being commanded. The mean value on RCIN4 (Yaw) is ~1600us and should be ~1500us with center stick. Do you have trim set on the transmitter? All trims should be centered under all circumstances. If they are not do so and perform another radios calibration.