On the one hand, the rules are the rules
On the other, it clearly didn't matter here
The rules actually address this.
163. 4. An athlete shall not be disqualified if he ...
(b) steps or runs outside his lane in the straight, any straight part of the diversion from the track for the steeplechase water jump or outside the outer line of his lane on the bend, with no material advantage thereby being gained and no other athlete being jostled or obstructed so as to impede his progress
There is a NOTE on what "material advantage" means, for instance getting out of a boxed-in position.
However, I don't think "material advantage" is the same as "making a difference" in the end results (for instance, get 3rd by 5 seconds, but only gained 1 second by cheating -- that's still a "material advantage").