Depends a bit on firmware. Can not say for others but repetier-firmware has bump correction for low Z. If you measure at 39.85mm the correction would be reduced to 0 normally. So try without bump/distortion correction. In repetier- firmware you could delete it with G33 R0. To rotation correction should be active as with your test so should not be the reason. If distance was ok on all sports using M114 I'd expect it in the print as well.