Simulated drone only partially takes off at certain locations

I’m having a weird problem regarding the takeoff height of my simulated copter.

I’ve set up a simulation environment according to this guide. If I now try to take off, using the DroneKit command simple_takeoff, my copter sometimes only partially takes off, stopping at a height below the targeted takeoff height and just hovers there.
I tried different locations from the file ardupilot/Tools/autotest/locations.txt and found out that the achievable AGL height is closely related to the AMSL height of the position the simulation is started with. At the simulator’s default location CMAC (the little airfield near the Monaro highway in Australia, 584m AMSL), a takeoff to 10m AGL is successful. At location AVC_copter at 1586m, the height converges around 7.624m above ground, but for every 1m you subtract from the starting altitude of 1586m, you gain 1m for the achievable takeoff height.Consequently, starting this location with a height to 1583 AMSL, the copter successfully reaches the desired 10m AGL.
I also made a personal starting location with an elevation of 291m, which shows the same behaviour as the AMC_copter location. with an achievable takeoff altitude of only 3.5m AGL.

Steps to reproduce:

  • Setup a simulation environment with the Ardupilot firmware compiled for CubeOrange
  • Start gazebo with gz sim -v4 -r iris_runway.sdf
  • Start sim_vehicle.py with sim_vehicle.py -v ArduCopter -f gazebo-iris --model JSON --map --console --mavproxy-args --out=udp:x.x.x.x:14550 -L AVC_copter
  • Takeoff to 10m using DroneKit’s simple_goto example

I more or less “solved” my problem by excluding Gazebo as the simulator. I took out the parameter --model JSON from the sim_vehicle script, making it

sim_vehicle.py -v ArduCopter -f gazebo-iris --map --console --mavproxy-args --out=udp:x.x.x.x:14550 -L AVC_copter

Since I never really needed Gazebo, this qualifies as a solution for me. However, I’d still be interested to learn what caused the aforementioned problems in the first place, so feel free to post other solutions.