Accessing Microsoft Teams using organizational or personal credentials
When you signed in on the web, did you use the yahoo.com address to sign in? If so, do you recall seeing a pop up asking you to choose signing into your personal account, or a work/school account?
Or did you use an organization account to sign in on the web?
According to the current error, it is saying you are trying to use an yahoo.com account to sign into an organization's environment (WSP O365), and they cannot find your yahoo.com account as their organization guest/visitor, hence they rejected your log in request.
This is why I am trying to understand what you are signing into with what account when you use the web.