Pitting on the final lap, when you enter the pits, it is technically the finish line, not the actual start finish line on the track.
He would not have dne a single lap on them, and completed the race before entering his pit box.