I think I might have an idea about this now, based on How can I use the Management API in Actions? - Auth0 Community.
One thing I have noticed is that the newest version of the ManagementClient apparently does not have a “getUserPermissions” method. Rather, this method has been moved to the “users” object and renamed:
const ManagementClient = require('auth0').ManagementClient;
const management = new ManagementClient({
domain: event.secrets.domain,
clientId: event.secrets.clientId,
clientSecret: event.secrets.clientSecret,
});
// This is different from previous versions
management.users.getPermissions({id: event.user.user_id});
Documentation: UsersManager | auth0