I had this Flagged issue in Mail but managed to fix it...
I had 6 Flagged emails showing on my works Exchange Account but no emails were Flagged and non appeared in the Flagged section. It drove me mad!
I finally fixed it by simply going into SETTINGS > ACCOUNTS & PASSWORDS > then I clicked on the appropriate ACCOUNT > then I just turned MAIL off and then turned it back on again and they disappeared. I also changed my MAIL DAYS TO SYNC from 1 MONTH to NO LIMIT as the same time so I'm not sure if this may of also helped?
iPhone 6s, iOS 11.3.1