Reproduction steps:
1. Create a new project
2. Create > UI Toolkit > UI Document
3. Double-click the newly created Asset to open UI Builder window
4. Drag and drop any Element into the Hierarchy (e.g. Button Element)
5. Select the newly added Element and change its Background color in the Inspector
6. Duplicate the Element
7. Undo all changes
8. Redo all changes
9. Observe the Console
Actual result: "Unable to parse UXML file" pop-up is displayed and “IndexOutOfRangeException: Index was outside the bounds of the array." errors are thrown
Expected result: No errors or pop-ups are thrown and all actions are redone
Reproducible with: 6000.0.81f1, 6000.3.22f1, 6000.5.8f1, 6000.6.0b8, 6000.7.0a4
Reproduced on: Ubuntu 24.04, macOS Tahoe 26.5 (M4)
Note: Issue is also reproducible in UI Staging Mode, where errors are spammed in the Console, Element duplicates are not restored and no "Unable to parse UXML file" pop-up is displayed