How to reproduce:
1. Open the "IN-136542" project
2. In the Hierarchy window, create a new GameObject
3. Select the GameObject
4. In the Inspector window, click Add Component > BugDemoComponent
5. In the Inspector window, on the BugDemoComponent component, expand the "Foldout outside content container" Foldout
6. In the Hierarchy window, deselect the GameObject
7. In the Hierarchy window, select the GameObject again
8. Observe the Inspector window
Actual result: The "Foldout outside content container" Foldout is collapsed
Expected result: The "Foldout outside content container" Foldout remains expanded
Reproducible with: 2023.1.0a10, 6000.0.71f1, 6000.3.11f1, 6000.4.0f1, 6000.5.0a9, 6000.6.0a1
Reproducible on: macOS 26.3 (M1 Max)
Not reproducible on: No other environments tested
Workaround: Delete the “BugDemoInspector.cs” file and uncomment all code in “workaround.cs” file