I've had some cases of that, and I think it's because the game decides position based on comparing the race times of the competitors rather than just raw position, since the latter is not always clear due to lag. You can consider online races as sort of like mass Time Trials with ship collision and the occasional weapons fire