Your suggested system is basically the same as in Mario Kart, but without accounting for players moving backwards. As evidenced by your comment, it's not trivial to come up with a problem-free solution.
Further, no programmer makes perfect decisions all the time. The system they used wasn't that overcomplicated and is similar to many racing games. The description in the video makes it sound slightly more complicated than it really is.
The differentiating bug here is that they allow the player to go from key checkpoint 0 to the last key checkpoint without, at that point, decrementing the internal lap counter, instead decrementing that only when you pass backwards over the finish line.
Further, no programmer makes perfect decisions all the time. The system they used wasn't that overcomplicated and is similar to many racing games. The description in the video makes it sound slightly more complicated than it really is.
The differentiating bug here is that they allow the player to go from key checkpoint 0 to the last key checkpoint without, at that point, decrementing the internal lap counter, instead decrementing that only when you pass backwards over the finish line.