Can't remove relation Flutter

To create a relation I use this code and the relation is created.

  Future<void> followUser(uid) async {
    var user = await UserModel.getObject(uid);
    var currentUser = await getCurrentUser();
    final relation = currentUser?.getRelation('subscribes');
    await currentUser?.save();

To remove a relation, I use a similar code, only I replace “add” with “remove”.

But the relation is not removed. And the following message appears in the parse-server logs: “Uncaught internal server error. Cannot read properties of undefined (reading ‘className’)”

Could you share the code you are actually using to remove and also the complete error stack?