This doesn't work for me.
Mac OS Catalina 10.15.7
Rebooted in safe mode, did rebuild on all the mailboxes, and the spurious flagged count of 1 is still showing up.
Previously, I flagged and unflagged every email in all my folders.
Getting kind of ridiculous.
MacBook Pro 13″, macOS 10.15