Reproduction steps:
1. Open the attached “UI Builder Issue.zip” project
2. Double click on the "UIDocument.uxml" in Project window to open UI Builder
3. Make some changes to the UI document without saving them (e.g. add a Visual Element child to the CustomElement already present in the UI Builder Hierarchy)
4. Select “CustomData.asset” and make changes in the Inspector window and save the changes
5. Observe the UI Builder window
Expected result: The UI Builder changes stay the same
Actual result: The UI Builder changes are being discarded
Reproducible with: 6000.0.12f1
Could not test with: 2021.3.41f1, 2022.3.39f1 (due to “Element 'CustomElement' has no registered factory method.” error)
Reproduced on: macOS Sonoma 14.5 (Intel), Windows 10 (by reporter)
Note: Issue is reproducible when saving changes with a shortcut “Ctrl+s” and with File > Save