Not that this helps, but enabling connection activity logging in Connection Doctor and then examining the log file showed:
WROTE Jan 18 12:32:02.251 [kCFStreamSocketSecurityLevelTLSv1_0] -- host:imap.mail.yahoo.com -- port:993 -- socket:0x6080002b53c0 -- thread:0x618000869580
7.1155 SELECT INBOX
READ Jan 18 12:32:02.369 [kCFStreamSocketSecurityLevelTLSv1_0] -- host:imap.mail.yahoo.com -- port:993 -- socket:0x6080002b53c0 -- thread:0x618000869580
* 5838 EXISTS
* 0 RECENT
* OK [UIDVALIDITY 1256329695] UIDs valid
* OK [UIDNEXT 30687] Predicted next UID
* FLAGS (\Answered \Deleted \Draft \Flagged \Seen $Forwarded $Junk $NotJunk)
* OK [PERMANENTFLAGS (\Answered \Deleted \Draft \Flagged \Seen $Forwarded $Junk $NotJunk)] Permanent flags
* OK [HIGHESTMODSEQ 6105761096092614656]
7.1155 OK [READ-WRITE] SELECT completed; now in selected state
WROTE Jan 18 12:32:02.370 [kCFStreamSocketSecurityLevelTLSv1_0] -- host:imap.mail.yahoo.com -- port:993 -- socket:0x6080002b53c0 -- thread:0x618000869580
8.1155 FETCH 1:5838 (FLAGS UID)
READ Jan 18 12:32:02.569 [kCFStreamSocketSecurityLevelTLSv1_0] -- host:imap.mail.yahoo.com -- port:993 -- socket:0x6080002b53c0 -- thread:0x618000869580
* BYE IMAP4rev1 Server logging out
8.1155 NO [SERVERBUG] FETCH Server error - Please try again later
Everything looks fine until the last command. Mail tried to fetch the messages in my Inbox and got a "FETCH Server error" in response. The strange thing is that it seemed to work fine on all other folders (Sent Messages, Drafts, etc.).