CIDs that need to be issued are appended to this vector. But when e.g. you have a lot of open paths they'll be added in PathId and sequence order. When they are being sent they are consumed using .pop() which means the back ones are taken first. If your PATH_NEW_CONNECTION_ID frames do not fit in one frame this means you first issue new CIDs for higher path numbers, before issuing them for e.g. PathId(0).
This would be fixed if we could pop items of the front, hence the VecDeque.