Automatic Launch with launchSitl Bash Script

I am facing issue of Arm: Leaning while doing the fully automated launch of the drone in sitl mode.

Waiting for vehicle to become armable.
Vehicle is now armable
Waiting for drone to enter GUIDED flight mode
Vehicle now in GUIDED MODE. Have fun!!
Waiting for vehicle to become armed.
CRITICAL:autopilot:Arm: Leaning

Also I tried running the basic_templete.py, with the following command

python basic_templete.py --connect 127.0.0.1:14550

and the takeoff sequence is happening normally as expected in the video tutorial.

I suspect the issue could be within the launchSitl file(attached below), but I am unable to debug the issue.

#!/bin/bash

kill -9 $(ps -eF | grep QG | awk -F ' ' '{print $2}') > /dev/null 2>&1
kill -9 $(ps -eF | grep ardu | awk -F ' ' '{print $2}') > /dev/null 2>&1
kill -9 $(ps -eF | grep mav | awk -F ' ' '{print $2}') > /dev/null 2>&1
kill -9 $(ps -eF | grep apm | awk -F ' ' '{print $2}') > /dev/null 2>&1

#######################
arducopterDir="/home/dronedojo/apm/ardupilot/build/sitl/bin"
$arducopterDir/arducopter -S -I0 --home 44.5013,-88.0622,0,180 --model "+" --speedup 1 --defaults /home/dronedojo/apm/ardupilot/Tools/autotest/default_params/copter.parm&

sleep 5

## Launch QGC
/usr/local/bin/QGC.AppImage 2>/dev/null&

sleep 5

##Start MAVProxy
screen -dm mavproxy.py --master=tcp:127.0.0.1:5760 --out=127.0.0.1:14550 --out=127.0.0.1:5762 --map

##Launch the dronekit python script
/usr/bin/python "$1" --connect 127.0.0.1:5762

###launchSitl "basic_templete.py"

function finish {
	kill -9 $(ps -eF | grep QG | awk -F ' ' '{print $2}') > /dev/null 2>&1
	kill -9 $(ps -eF | grep ardu | awk -F ' ' '{print $2}') > /dev/null 2>&1
	kill -9 $(ps -eF | grep mav | awk -F ' ' '{print $2}') > /dev/null 2>&1
	kill -9 $(ps -eF | grep apm | awk -F ' ' '{print $2}') > /dev/null 2>&1
}

trap finish EXIT

Update:
I tried modifying the commands slightly. The command chnage which I tried in the bash script is

 /home/dronedojo/apm/ardupilot/build/sitl/bin/arducopter --home=44.5013,-88.0622,198.5,180 --model "+" --speedup 1 --defaults $apm/ardupilot/Tools/autotest/default_params/copter.parm&

Is something wrong with the height setting which I have selected, which is causing the problem below.

Vehicle is now armable
Waiting for drone to enter GUIDED flight mode
Vehicle now in GUIDED MODE. Have fun!!
Waiting for vehicle to become armed.
Look out! Virtual props are spinning!!
Current Altitude: 0
Current Altitude: 0
Current Altitude: 0
Current Altitude: 0
Current Altitude: -7
CRITICAL:autopilot:Vibration compensation ON
Current Altitude: -16
Current Altitude: 2
Current Altitude: 0
Current Altitude: 0
Current Altitude: 0
Current Altitude: 0
Current Altitude: 0

Clearly not normal for a clean install. I ran it without issue. There is something else going on. It seems to be an IMU issue. What other changes did you make after the initial install?