Old question but still relevant. I am not sure as to what exactly leads to NuGet being unable to use the "Windows authentication broker", but at least for me that was the issue in the end.
Go to Tools > Options > Accounts and select anything but the "Windows authentication broker". Log out and back into your accounts via the new sign in option. And for good measure restart VS.
To be frank: I don't understand why NuGet (within VS) doesn't use the Credentials provided via the %AppData%\NuGet\NuGet.config
file. They work just fine when using dotnet restore
or nuget restore
from either PowerShell or cmd shell (even from VSs inbuilt PowerShell window). But it is what it is.
I also answered this question here: https://stackoverflow.com/a/79274415/6289706