There are 2 possible causes:
1) DBC.RoleGrants has a role identifier that does not have a corresponding entry in DBC.Roles.
(There is left-over entry in DBC.RoleGrants table)
2) role is dropped during SQL execution
Below is sample scenario for case 2:
e.g. role1 is assigned to user1. user1 runs "Select * From DB1.Tbl1;".
2-1) we retrieve RoleId of role1 from DBC.RoleGrants
2-2) role1 is dropped by other request
2-3) we try to retrieve row from DBC.Roles using RoleId
2-4) Since the RoleId has been already dropped, 5626 warning is returned
(But SELECT works fine as user1 itself or other role has SELECT right on DB1 )