Reproduction steps:
1. Open the attached “BugRepro” project
2. Open the “Assets/UIDocument.uxml file
3. Select the “GfxTestContainer” element in the Viewport pane
4. Select again the “GfxTestContainer” element, hold and move it in the Viewport pane
5. Press undo (Ctrl+ Z)
6. Observe the Viewport pane and Console window
Expected result: No error is thrown and element returns to its original location
Actual result: “IndexOutOfRangeException: Index was outside the bounds of the array” error is thrown and element returns to the wrong location
Reproducible with: 2021.3.38f1, 2022.3.28f1, 6000.0.1f1
Reproducible on: Windows 11
Not reproducible on: No other environment tested