I use Microsoft 365 Exchange Server for one of my email accounts. I use Apple Mail for my email client on my Mac (Catalina at the moment). Intermittently when I move my emails to other mailboxes on my Mac (not online), the exchange server refuses to delete my email in the online inbox. So they're then in 2 places: on the Exchange server in my inbox and on my Mac in their mailboxes.
Sometimes the emails will suddenly also reappear in the Apple Mail inbox, but usually not.
Occasionally I am able to fix this by entering and exiting Outlook on Office 365. Sometimes it fixes the situation suddenly on its own for no apparent reason. Often I have to delete my email account on my Mac, then restore it, and then wait for the emails to download. Once I do that, the emails I moved disappear from my Apple Mail inbox and are only where I put them in the mailboxes on my Mac.
Over the years I have spoken with Apple support, and they've told me that there are some issues with Microsoft Exchange servers and Apple Mail.
Can someone explain this to me and let me know if there's a way to fix this problem more simply and quickly.