How to reproduce:
1. Open the user’s attached project “HideFlags.zip”
2. Open the “SampleScene” Scene
3. Select the “Prefab” GameObject in the Hierarchy
4. Right-click the “Hider” component > Add Component > Apply to Prefab ‘Prefab’
5. In the Project window select the “Prefab” Prefab
Expected result: Component is not applied to the Prefab
Actual result: Component is applied to the Prefab
Reproducible with: 2020.3.42f1, 2021.3.14f1, 2022.1.23f1, 2022.2.0f1, 2023.1.0a20
Reproduced on: Windows 10