I would like to add that the request that returned this error was:
https://www.mymoodle.com/webservice/rest/server.php?moodlewsrestformat=json&wsfunction=core_enrol_get_users_courses
https://www.mymoodle.com/webservice/rest/server.php?moodlewsrestformat=json&wsfunction=core_enrol_get_users_courses