There is a bug that is ignored by MongoDB Atlas team. And they disallow people to report any bugs.
I am taking directly example from their documentation. I assume there is no other way to reach this working under settings as filtering rule on documents under Apply when in App services?
Error: Request failed (POST https://xxx.gcp.realm.mongodb.com/api/client/v2.0/app/xxx/functions/call): failed to check role readAll (status 500 Internal Server Error)