In fact, car #12 had already exceeded track limits four times before Lap 28. He should have received a 5-second penalty during his second pit stop and would have rejoined behind car #4.
Then, if he had gone off track again while chasing (which he always does), that would have been his fifth offense, resulting in a 10-second penalty. So the idea that car #4 “got lucky”is simply not true. At best, car #12 was only ever going to finish P4.
The FIA’s handling of the penalties was also quite interesting. Automated detection had already recorded four track-limit violations before Lap 28, and another two after Lap 28. However, it wasn’t until McLaren repeatedly complained that the FIA finally counted the Lap 10 track-limit infringement.
In the end, the official document ignored the two violations after lap28, even though for the other drivers, the number of track-limit violations listed in the documents matched the automated detection data exactly.