The error message states that the account is not not in the tenant when you are trying to sign in from the Visual Studio 2019.
This is what I believe could be happening - when you are signing in from the browser you are logging in to a tenant, lets say Tenant 2.
However, when you are in Visual Studio it is generally where you are working on your Azure Resources. So the tenant which the Subscription, lets say Subscription 1, is associated with would be a different tenant, like Tenant 1.
So here's what I suggest - when you login to the browser, check if you are able to view the Azure Resources (without changing the directory). If not, use an account credential from the Tenant associated with the Subscription and try again.
-----------------------------------------------------------------------------------------
Do click on "Mark as Answer" on the post that helps you, this can be beneficial to other community members.