How to reproduce:
1. Open the attached project “IN-22259.zip“
2. Open the “SampleScene” scene
3. Select the “Cube“ GameObject in the Hierarchy window
4. Press the “Ctrl + plus“ command on the keyboard
5. Undo
Expected result: Pressing the undo command reverts the changes made in the Hierarchy window
Actual result: Pressing the undo command does not revert the changes made in the Hierarchy window
Reproducible with: 2020.3.42f1, 2021.1.0a10
Not reproducible with: 2021.2.0a1, 2021.3.15f1, 2022.1.24f1, 2022.2.1f1, 2023.1.0a22
Reproduced on: Windows 10 Enterprise, macOS Monterey 12.6