Accorging to User Role documentation, when a role is added to a user, it overrides the existing groups
I created a user and a user role, added all groups to the user role (res.role-res.group) and add the role to user (res.user.role), all in same transaction. If I create a sequence with this user I get:
You are not allowed to write to records "XX" of "Sequence" because of
at least one of these rules:
User in groups
As you do that in a single transaction, I guess it depends on how things are done.
For example, synchronization of roles are only done when User is written (not if the relation is created).