Right now it seems like any offs in the last 10-25% of the track distance will invalidate your next lap. This is a good catch-all, but is waaaay too large on some tracks. For instance, going off at the beginning of the porsche curves at lemans will invalidate your next lap, even though there is no way to gain an advantage there that will last until the next lap. I can't recall which ones, but I know this is an issue on other tracks as well.