Hey there,
This question might need some clarification but I’ll take a first stab at what I think you are asking. The set_user_role action is called at the end of the encompassing set_role() function which removes all previous roles and sets the new role passed to it. Your SQL query reflects that the DB is indeed cleared of all caps except the new single role added at the point this action is called.
I believe The WPFront User Role Editor plugin manages additional roles by using the above set_role() function to first set the primary role, and then iteratively calls the add_role() function to add back all secondary roles associated with a user.(which appends, rather than replaces the existing roles) This would account for why the later query appears to have all the roles in it again. As a test, you could hook into the related add_user_role action called at the end of the add_role() function to see the other roles added one by one.
Depending on what you need to do, you may be able to get all the roles by using the $old_roles parameter that is passed from the set_user_role action. This is an array of all the roles that were just removed. It is important to note though that this won’t reflect different roles were added back than were before the roles were updated. (Like through the User Role Editor plugin). If you truly need the current roles then you might need to find a different spot to hook into after the User Role Editor plugin has finished executing all it’s code.