Internal filtering flags used to obtain AnimData blocks as result were not working correctly in Action and ShapeKey modes. Instead, in these modes, they were often returning F-Curves instead, which lead to the grouping operating failing (and perhaps other unidentified bugs)