The issue occurred when creating a keylist for an FCurve. Keys outside the given range are ignored, but the call to `update_keyblocks` still got the full range leading to the assertion. The fix is to keep track of the index range for which bezt have been added to the keycolumns. Note that we have to do that within the loop because the FCurve might not be ordered (e.g. during transforms in the dope sheet) Pull Request: https://projects.blender.org/blender/blender/pulls/125678