edit: oh, since you didnt write show us your hasAnyRole() method, i assume now, do you use the spatie permissions package? if so, it has a scope to query only certain roles.
$users = User::role('writer')->get(); // Returns only users with the role 'writer'
The role scope can accept a string, a \Spatie\Permission\Models\Role object or an \Illuminate\Support\Collection object.
You get a Collection from pluck; so this is not what you need. Instead, consider the role scope which should allow you to scope the User query correctly (assuming the User model uses the HasRoles trait