Probably up to where the contact point/collision is calculated if I had to guess. But it might also have to do with margin of error in physics precision. Or both.
In physical terms and specifically about the shift to the side, that makes sense since force has to be transferred somewhere. If the floor is (from the physics engine POV) a immovable object with no elasticity or anything then for energy conservation purposes all it can do is reflect that force.
Looking at your gif it looks like it's inheriting some of the angle from the floor on the jump and shifting in air though.
Far as I can tell it can only be up to line 48 in the second image.