Switch Role

i have create a table with one to one relationship with users and many to many relationship with roles and tried to give role user mapping with stakeholder by inserting the data in rolesUsers table in backend
but it works fine by functionality but in the UI switch role it is not reflected how to achieve this

Adding roles to users in a database table does not immediately apply to system permissions. In such cases, a system restart or data modification via API is required.
https://docs.nocobase.com/api/actions#set