Reproduction steps:
1. Open the attached “TryVFXEffect.zip“ project
2. Open the Preferences window (Edit > Preferences…) and enable Verbose Mode for compilation
3. Enter Play mode and select “Visual Effect” GameObject in the Hierarchy
4. Select any other GameObject in the Hierarchy and observe
Expected result: Other GameObject is selected
Actual result: Editor freezes
Reproducible with: 2022.3.31f1
Not reproducible with: 2022.3.33f1, 6000.0.7f1
Couldn't test with: 2021.3.39f1 (Due to errors in the Console)
Fixed in: 2022.3.32f1
Reproduced on: Windows 11 Pro
Not reproduced on: macOS Sonoma 14.5 (Intel)