The problem happens because when a facemap is moved from the end of the list to the beginning or from the beginning to the end, the indexes of all facemaps should be modified with an offset.
But the swap function is called instead, changing only 2 indexes.
We could do a solution similar to that of the Vertex Group and prevent a facemap from being moved beyond the limits.
Or we can use this patch's solution and update all indexes.
Ref T79973