XY end stops are not always tested. Especially during print you might want them disabled to prevent wrong triggering that will ruin the print.
// You can disable endstop checking for print moves. This is needed, if you get sometimes
// false signals from your endstops. If your endstops don't give false signals, you
// can set it on for safety.
#define ALWAYS_CHECK_ENDSTOPS 1
There is no dependency distortion correction - end stop testing.
From your description I take that y axis is moved much slower then z axis, also z axis has more steps, correct? I mean if 2mm back move are sufficient it can't be much. Of course it should be zero steps during z move. But it can in deed move a bit when autoleveling is enabled depending on the rotation of bed. But not on the testing move as they are axis only. Only when positioning afterwards. So still a strange issue.