Reproduction steps:
1. Open the attached project “CrashRepro“
2. Open “Scenes/SampleScene.unity“ Scene
3. Select “Cube“ Prefab in the Project window
4. Remove the Animator Component in the Inspector window
5. Drag “Anima“ Animation into the Inspector
Expected result: Animation Component gets added
Actual result: Editor crashes
Reproducible with: 2021.2.0b12, 2021.2.19f1, 2021.3.16f1, 2022.1.0a4, 2022.1.24f1, 2022.2.2f1, 2023.1.0a24
Not reproducible with: 2020.3.42f1, 2021.2.0b11, 2022.1.0a1, 2022.1.0a3
Reproducible on: Windows 10
First lines of the stack trace:
0x00007ff656ee603a (Unity) SerializeObjectAndAddToRecording
0x00007ff656eead6f (Unity) PropertyUndoManager::RecordObjects
0x00007ff656eeb006 (Unity) RecordUndoDiff
0x00007ff656a1f9e9 (Unity) HandleAnimationClipOnAnimator
0x00007ff656a1fdb8 (Unity) HandleAnimationOnGameObject