Reproduction steps:
1. Open the attached “repro-project“
2. In the Hierarchy window expand the "Terrain v3" GameObject
3. Expand the "Terrain" GameObject under "Terrain v3"
4. Select all "Terrain"'s “Tree” child GameObjects
5. In the Inspector window remove the “Mesh Collider“ Component
6. Wait for the “Menu.Remove Component“ Unity’s code to finish
7. Click anywhere in the Editor
8. Observe the crash
Reproducible with: 2021.2.9f1, 2021.3.23f1
Not reproducible with: 2020.3.47f1, 2021.2.8f1, 2022.2.16f1, 2023.1.0b13, 2023.2.0a11
Reproduced on: Windows 10 Pro
First few lines of the stack traces:
{{0x00007FF735D1D52C (Unity) UndoManager::FlushTrackedObjects }}
{{0x00007FF735D214F4 (Unity) UndoManager::IncrementCurrentGroup }}
{{0x00007FF735E41E00 (Unity) ProcessMainWindowMessages }}
{{0x00007FF735E62EDC (Unity) ContainerWindow::ContainerWndProc }}
0x00007FFCF6E2E858 (USER32) CallWindowProcW
{{0x00007ff7b2bd14f4 (Unity) UndoManager::IncrementCurrentGroup }}
{{0x00007ff7b27ca4e8 (Unity) GUIView::ProcessInputEventFromAPI }}
{{0x00007ff7b27ca3c8 (Unity) GUIView::ProcessInputEvent }}
{{0x00007ff7b2d1c96d (Unity) GUIView::ProcessEventMessages }}
0x00007ff7b2d16629 (Unity) GUIView::GUIViewWndProc