V1.11 auto takeoff

I am using quadcopter in indoor environment (motion capture), no GPS. Just upgraded to v1.11.0
The issue I encounter: when taking of not from the origin (x=y=0) the drone tends to reach this position during takeoff (high pitch/roll).
It may be observed in the attached screenshot (at t=110 I command takeoff and at t~115 I command land due to high pitchdown) that vehicle position setpoint goes there.
I think the issue comes from the following lines. When I changed them to When I changed it to get “NAN” (as in v1.10) takeoff is ok.