Hey David,
Based on your reply, you are still struggling with the Yahoo! account in your Mail app. Connection Doctor showed no issues with incoming or outgoing servers when this happened. You don't have any issues with your password, as you can login on the webmail. Deleting the email account and re-adding hasn't resolved it. But you've also tested this in safe mode, restarted, but it persists. We'll get to the bottom of this!
When you tested in safe mode, what happened when you logged in? Were you able to open the Mail app and use it as expected, without any issues receiving emails? If so, then we know this is related to some software running on the Mac. Check in section, "If the issue continues in safe mode" here: How to use safe mode on your Mac If the issue continued in safe mode, check under section "If the issue doesn't continue in safe mode" in that article above.
If it happened in safe mode, testing in another user would help to isolate this even further: How to test an issue in another user account on your Mac The results of testing in safe mode tells us if there is any potential software that could be interfering. Testing in another user, tells us if it's specific to your user or all users on your Mac.
We would also check on your network connection when this happens. Do you have any issues accessing specific websites using a browser when you can't get Yahoo! emails? Could this be related to the network or rejoining the network after the Mac is asleep? If so, this may assist:
If your Mac doesn't connect to the Internet over Wi-Fi
Hope it helps!