g_user.hasRole is returning false if users have external roles. If user has roles like snc_external or sn_customerservice.customer combined with any other internal role like 'itil' g_user.hasRole for itil will return even though user has this role.
This behavior is expected. snc_external or sn_customerservice.customer is a special role which is used to indicate a user is an external user. getRole() for an external user always return false since by definition an external user has no role on an instance.
Here is the documentation about it: The hasRoles() method