How to reproduce:
1. Open the “ReproduceBugs“ project
2. Open the “TestScene“
3. Open the “GameObject“ Prefab instance in isolation
4. Add the “testbla“ Script component to the “GameObject“
5. Return to the “GameObject“ Prefab instance edit in context
6. Add the Animator component to the “GameObject“
7. Un-comment the 5th line of code in the “testbla.cs“ script
8. Right-click on the Animator component and choose “Added Component > Revert“
Expected result: No errors are thrown and the “GameObject“ Prefab instance gets reverted to the Prefab state
Actual result: An error “Can't remove Animator because testbla (Script) depends on it. UnityEditor.GenericMenu:CatchMenu (object,string[],int)“ is thrown and the “GameObject“ Prefab instance doesn’t get reverted to the prefab state
Reproducible with: 2021.3.39f1, 2022.3.33f1, 6000.0.6f1
Reproducible on: macOS 14.5 (Intel), Windows 10 Pro (22H2)
Not reproducible on: No other environments tested
Note: Since the Prefab itself has the required Component, reverting to the Prefab state should satisfy the restriction from the RequireComponent attribute