Since the roles for a user are stored in (dbprefix)_capabilities, I’d try grabbing the database prefix and then using it to grab people with the right capabilities (caps are in a serialized array):
global $wpdb;
$prefix = $wpdb->prefix;
$meta_name = "{$prefix}capabilities";
'meta_query' => array(
'relation' => 'OR',
array(
'key' => "{$meta_name}"
'value' => 'program_manager',
'compare' => 'LIKE'
),
array(
'key' => "{$meta_name}",
'value' => 'administrator',
'compare' => 'LIKE'
)
)
);
The above should give you all users that are program managers or administrators.
The thing I see that may have broken your code is as follows:
if( is_array($user->role) == true){
# This will break your meta query as it could create "subscriber, administrator" as a key
# and your meta query does 'key' => $staff_role
$staff_role=esc_attr(implode(", ",$user->role));
} else {
$staff_role=$user->role;
}
The second a user gets a second role, the query starts looking for a key value that contains comma separated roles. Of course, maybe that is what you seek, but I’d double check in the database as such a key would be a bit odd.