meta_query in WP_User_Query not working – returns every user, not just users where key & value matches

I’ve tried the meta query on another simple wordpress site, and it works there, so there must be something else going on, meddling with the query..

I’ve been doing some digging with the Query Monitor plugin… I thought it might have been because I’ve also been meddling with pre_user_query, but I can see that I don’t have any actions attached to that hook… so nvm that…

but i can see the query being called. This is what it looks like, and as suspected the meta keys in the meta query is not being included:

SELECT DISTINCT SQL_CALC_FOUND_ROWS wp_users.*
FROM wp_users
LEFT JOIN wp_usermeta
ON (wp_users.ID = wp_usermeta.user_id
AND wp_usermeta.meta_key = 'ur_user_status' )
LEFT JOIN wp_usermeta AS mt1
ON ( wp_users.ID = mt1.user_id )
LEFT JOIN wp_usermeta AS mt2
ON ( wp_users.ID = mt2.user_id )
WHERE 1=1
AND ( ( ( wp_usermeta.user_id IS NULL
OR ( mt1.meta_key = 'ur_user_status'
AND mt1.meta_value="1" ) )
AND ( mt2.meta_key = 'wp_3_capabilities' ) ) )
ORDER BY user_login AS

It includes some weird user metadata that seems to be added by the User Registration plugin.

I deactivated the plugin, and now the meta query works…. huh