Compass and accelerator errors on SITL?

I am using SITL with a new aircraft model I defined with xml files used in Jsbsim. The aircraft is perfectly controllable in manual mode in FlighGear with an external transmitter control through the Mission Planner. However when I switch to auto mode I get compass and accelerator errors all over the place and the airplane behaves chaotically - it can not follow the watpoints.

Does STIL require compass and accelerometer calibrations? But how, there is nothing physical in hand - it is all software! In any case while flying I was able to calibrate the accelerometer and the compass. But nothing has improved. Is this a bug or some error in my param file? I am puzzled, any hint would be invaluable.

I figured out what the problem was through an elminatiion method - it was with the undertrain somehow failing to keep the plane steady on the ground. When I swapped the order of the definitions for the left gear and the right one (the bogeys), the problem magically got resolved. A bug?