Unable to delete member from Team

Description

We are unable to delete a member from a team

  1. Go to Team
  2. Click on Team Members icon
  3. Click on the member to remove
  4. Click on the 3 dot menu
  5. click red text “Remove from Team”
  6. Click Remove button in confirmation
  7. RocketChat shows a red toast message of “Error”

Console log shows a 400 error
https://chat.ourdomain.com/api/v1/teams.removeMember
error: “member-does-not-exist”
success: false

Server Setup Information

Version 4.6.2
Apps Engine Version 1.31.0
Node Version v14.18.3
Database Migration 258 (April 18, 2022 5:00 AM)
MongoDB 4.2.17 / wiredTiger (oplog Enabled)

Any additional Information

{“level”:35,“time”:“2022-05-12T14:51:49.310Z”,“pid”:858689,“hostname”:“rocketchat”,“name”:“API”,“method”:“POST”,“url”:"/api/v1/teams.removeMember",“userId”:“zgq2YHheP3qJispba”,“userAgent”:“Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36”,“length”:“66”,“host”:“127.0.0.1:3000”,“referer”:“https://chat.ourdomain.com/group/Profit-Scanner-Channels/members-list",“remoteIP”:“136.33.209.xxx”,“err”:{“type”:“Error”,“message”:“member-does-not-exist”,“stack”:"Error: member-does-not-exist
at server/services/team/service.ts:749:11
at /snap/rocketchat-server/1515/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/fiber_pool.js:43:40
=> awaited here:
at Function.Promise.await (/snap/rocketchat-server/1515/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/promise_server.js:56:12)
at server/sdk/lib/LocalBroker.ts:15:15
at /snap/rocketchat-server/1515/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/fiber_pool.js:43:40
=> awaited here:
at Function.Promise.await (/snap/rocketchat-server/1515/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/promise_server.js:56:12)
at app/api/server/v1/teams.ts:512:8
at /snap/rocketchat-server/1515/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/fiber_pool.js:43:40
=> awaited here:
at Function.Promise.await (/snap/rocketchat-server/1515/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/promise_server.js:56:12)
at app/api/server/api.js:425:75
at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1257:12)
at Object._internalRouteActionHandler [as action] (app/api/server/api.js:425:39)
at Route._callEndpoint (packages/rocketchat_restivus/lib/route.coffee:150:32)
at packages/rocketchat_restivus/lib/route.coffee:59:33
at packages/simple_json-routes.js:100:9”},“status”:400,“responseTime”:33,“msg”:“member-does-not-exist”}