Calling `action.fcurves.clear()` would clear the F-Curves, but didn't update the F-Curve groups. This meant that the groups data still had their original length & offsets into the F-Curves array, causing subsequent F-Curve creation to crash Blender. The unit test for this also covers the previous commit. Pull Request: https://projects.blender.org/blender/blender/pulls/128375