A call with moodle_user_get_users_by_id() over XMLRPC fails when no custom user fields are defined for a user.
To reproduce just use the XMLRPC test client with users without custom fields. The faultString returned by the xmlrpc server:
"Invalid external api response: customfields (Only arrays accepted.)"
The patch attached solves the problem.
Thanks in advance