Reproduction steps:
1. Open any Unity project
2. Create any GameObject
3. Inside the created GameObject create a 3D Cube GameObject
4. Duplicate the 3D Cube GameObject
5. Undo
Expected result: Editor does not crash
Actual result: Editor crashes
Reproduced in: 2021.3.9f1
Not reproduced in: 2020.3.39f1, 2021.3.8f1, 2022.1.16f1, 2022.2.0b7, 2023.1.0a9
Reproduced using: macOS Monterey 12.0.1, Windows 10
Notes:
1. GetTransformAccess seems to be macOS related. Windows crash stack frames do not have it
2. Not reproduced when undoing duplication of an empty GameObject
First few stack frames (with 3D objects):
#0 Transform::GetTransformAccess()
#1 RendererUpdateManager::RemoveRenderer(Renderer&)
#2 Renderer::RemoveFromScene()
#3 Renderer::Deactivate(DeactivateOperation)
#4 GameObject::ActivateAwakeRecursivelyInternal(DeactivateOperation, AwakeFromLoadQueue&)
First few stack frames (with UI objects):
#0 Transform::GetTransformAccess()
#1 UI::CanvasRenderer::Deactivate(DeactivateOperation)
#2 GameObject::ActivateAwakeRecursivelyInternal(DeactivateOperation, AwakeFromLoadQueue&)
#3 GameObject::ActivateAwakeRecursively(DeactivateOperation)
#4 GameObject::Deactivate(DeactivateOperation)
First few stack frames (with light objects):
#0 Transform::GetTransformAccess()
#1 LightManager::RemoveLight(Light*)
#2 Light::RemoveFromManager()
#3 GameObject::ActivateAwakeRecursivelyInternal(DeactivateOperation, AwakeFromLoadQueue&)
#4 GameObject::ActivateAwakeRecursively(DeactivateOperation)