The issue arises from an improper authorization check on removing shares. Specifically, the Sharing Backend in Nextcloud differentiates between shares to users and groups. In the case of a received group share, users should be able to unshare the file to themselves but not to the whole group. However, the previous API implementation simply unshared the file to all users in the group.