When a person wants to encode less than 6 numbers e.g. [6,1,2], because they do not know who comes after them, in order for Lehmer encoding to work they need to fill in the remaining slots up to 6 with the numbers that were not taken so far; the order of those remaining numbers does not matter, the next person who decodes this number will know that they are 4th in order (since they know theytheir own order) and they will be able to discard all the numbers but the first 3 based on that.
Now we are coming to the second part. The 7th person in king's order got the encoded number from the 6th person and by incrementing back every number on the list that is equal or greater than their cell number, and then appending their own cell number at the end, they will get the complete list. [6,1,2,4,5,3] for the seventh person in cell 3 will become [6->7,1,2,4->5,5->6,3->4], or [7,1,2,5,6,4], and after adding the final cell 3 we arrive to the initial [7,1,2,5,6,4,3] list. Now this last person needs to do the last final encoding, that will give the rest of the team their final answer. In order to do that this person will a) rearrange the cells list so that the people in the list appear in pre-agreed order, e.g.: Ann, Ben, Cid, Dan, Eve, Flo and Guy; and b) will re-label each room number by adding the same offset by modulo 7 to each room. The offset is chosen so that Guy always ends up in the room 7 after re-labelling. After those two steps we will get the 7 cell numbers in the list, with the last number being 7, because the last person is Guy and we chose the offset so that they are always in the room 7. The last person in the king's order takes the first 6 numbers from this list and encode them and put them on the clock face for everyone to see next day on the way back to the king.