When you delete a message from any folder the server is notified of the deletion, which means you need an Internet connection to complete the deletion. And, if the Internet connection is slow, it can take a while to complete the process. So you should wait for it to complete. If you select a lot of messages for deletion you should allow a “suitable” amount of time for the operation to complete, and don’t close the Mail app until it completes. If it takes more than a few seconds for a small number there is a problem, but for a large number wait a couple of minutes for it to complete.
And important question is what kind of email account (iCloud, Hotmail, Exchange, Yahoo, AOL, etc)?