How to reproduce:
1. Create a project
2. Select a GameObject in the Hierarchy
3. In the Title Bar menus select Component > Add
4. Observe the Console
Expected result: No errors are logged in Console
Actual Result: Errors thrown in Console: "Assertion failed on expression: '!m_InsideContext'
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)"
"GUI Window tried to begin rendering while something else had not finished rendering! Either you have a recursive OnGUI rendering, or the previous OnGUI did not clean up properly."
"InvalidOperationException: Stack empty."
Reproducible with: 2021.3.14f1, 2021.3.29f1, 2022.3.8f1, 2023.1.9f1, 2023.2.0b6, 2023.3.0a2
Not reproducible with: 2021.3.13f1
Note: Issue reproducible through the new Context Menu is handled in this issue: [Internal link]
Reproduced on: macOS Ventura
Not reproducible on: Windows 11