You are correct. IMAP is showing you what is on the server. Whatever you do locally happens to the server and vice versa. So if you don’t want to delete the message from the server, don’t delete it from your phone.
Don’t worry about your phone’s mailbox filling up. Any reasonable IMAP app will purge your local copy of messages you haven’t recently viewed, and will re-download the content when you next view the message.
If you don’t want to see the message on your phone, consider moving older messages to a folder or use a smart mailbox (e.g. one that only shows unread messages and those read within the last 2 weeks or something similar) to hide older messages that you don’t want to see but don’t want to delete.
Getting back to your question, though:
If your old account was using POP, then the messages you downloaded are going to be on your phone and not on the server (unless you explicitly configured your POP client to not remove messages after download).
If you delete your old mail account from the phone, its messages will get deleted. And if that’s your only copy, they will be gone.
But it’s not as bad as it seems. You can create your new mail account without deleting the old one. Do this instead of changing the configuration of your existing mail account.
Even when the old account is shutdown, your local mailboxes will not go away until you delete the account from your phone, even if that account can no longer fetch new messages from the server.
So you can keep the old mailbox(es) as an archive for as long as you want to keep them.
Or you can move them to local folders on the new account if you want to keep them all in the same place. And once they’re all moved, there won’t be anything to lose if you later delete the old account.
And, of course, this is an advantage of POP over IMAP. With IMAP, once you lose access to the server, you will lose access to the messages (at least anything not already cached locally). If you decide to drop an IMAP mail provider, you must move the messages elsewhere (e.g. local folders) before you lose access to the server. Whereas with POP, what you have on your device will remain there until you choose to delete it.