Looks like guest account in Tenant B is disabled. I tried the same in my lab tenant and I am able to reproduce the issue.
I disabled the account in Tenant B and pulled the guest user properties using PowerShell. I see as below,
I logged in to tenant A using user credentials and I am able to login. I tried to switch the directory and selected tenant B. I got below error as you had mentioned in your post.
I have re-enabled the account in tenant B using below command,
Set-AzureADUser -ObjectId "xxxxx.onmicrosoft.com#EXT#@xxxxxxx.onmicrosoft.com" -AccountEnabled $true
Now in PowerShell result I am able to see the account is enabled.
I am able to access the tenant B directory using the user account.
To fix this issue you can run above command and the issue will be resolved.
Let me know if you have any further questions.
Please "Accept the answer" if the information helped you. This will help us and others in the community as well.