Since forever (or electronic timing and photofinish cameras at least), the rules have been that if you finish within a second of the previous rider, you are part of the same group, and a group gets the same time as the lead rider in that group.
In sprint stages, it is quite common for tailing off leadout riders to leave gaps, and if you are the wrong side of a 1.5 second split, you may lose 15 or 20 seconds. Consequently, GC riders (and their associated protectors) were trying to stay at the front until the the final sprint started, not sprinting, and generally getting in the way of the sprinters, possibly resulting in extra crashes.
So, two or three years ago, the UCI decided to reduce this danger by increasing the required inter-group gap from 1 second to 3 seconds in those stages expected to end in bunch sprints, so there wasn't the same need for GC riders and their associates to stay near the front.
In this case, the Vuelta organisers declared that this stage (10) was an expected bunch sprint stage, and that the 3-second rule would apply, and the commissiaires confirmed this before the start. However, at the end, having watched the finish, they changed the rules, saying that the 1-second rule applied.
Carapaz, being the wrong side of a short split therefore lost 3 seconds to Roglic that he wouldn't have lost had the rules as at the start of the stage been applied.
The consequences of this decision are...
a) Carapaz lost the red jersey
b) The 3-second rule may as well no longer exist, since GC riders and associates will revert to staying close to the front in case the commissiaires should change the rules after the event again.
c) In the (unlikely) event that Carapaz loses the Vuelta by less than 3 seconds, the commissiaires and/or the UCI may find themselves in court. People like Jim Ratcliffe tend not to have a history of rolling over to the diktats of petty bureaucrats.
d) the start of stage 11 got delayed a little.
In further news, nice to see Hugh Carthy take a good win on an iconic finish.