Do you enable 'Automatically sign in to sites with your current work or school account' for both profiles?
Besides, you can open this page edge://settings/profiles/multiProfileSettings in Edge for both profiles, disable all the settings under 'Automatic profile switching' and clear all the sites under 'Choose preferred profile for sites'.
In my test, after setting, using profile A, Edge will sign in portal.office.com with profile A account; using profile B, Edge will sign in portal.office.com with profile B account.
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Regards,
Yu Zhou