Reproduction steps:
1. Open the attached project “LayerBug“
2. Open the scene “Assets/Scenes/SampleScene”
3. In the Hierarchy window select the GameObject “Main Camera”
4. In the Inspector window select the “Culling Mask” dropdown
5. Observe the dropdown items
Expected result: The dropdown displays all available Layers
Actual result: The 31st Layer is not displayed, errors are logged in the Console Window
Reproducible with: 2022.2.3f1, 2022.2.5f1
Not reproducible with: 2020.3.44f1, 2021.3.17f1, 2022.2.2f1, 2023.1.0a1, 2023.1.0b1
Reproducible on: Windows 11