Is there a way to make a button visible only to certain users using badges as permissions?

I’m trying this with a custom-created role, but it’s not working because when a member who has this custom role is logged in, their role is returned as “Member” rather than the role’s name that I set. Does this not work with custom roles?