Yes, Mail can get confused with outgoing servers on occasion; often just quitting and restarting Mail will set things right.
When it doesn’t, you need to carefully set each account to use the specific server for which it has a user name and password. Otherwise, in an emergency, you can, for example, use your outgoing Gmail credentials to send a mail composed via Mac.com address; but your recipient will end up seeing it as being from your gmail.
Back to the solution:
Mail -> Accounts -> Server Settings -> Outgoing Mail Account -> [choose the corresponding server for each account]
Now, you mention you have ‘iCloud 1’ and ‘iCloud 2’, etc…, so you’re first going to need to access the ‘Edit SMTP Server List…’ ; from there, you will need to carefully examine the User Name for each listing, and then change the Description field to more easily reflect each account; e.g., if you have David.Tuma@gmail.com and David.Tuma@mac.com, you should rename the the Descriptions as DT@gmail and DT@Mac, respectively; repeat for each mail account you own.
You can also verify your passwords while you’re there, but don’t mess with that if you’re not yet actually getting an error that specifies a bad username or password.
If you are having trouble actually sending outgoing mail with a given server after this is done, you will want to launch Menubar -> Window -> Connection Doctor to determine exactly which servers work, and which don’t. Usually you can discern the issue form the error messages; typically it’s an issue of using the wrong port, security setting, or certificate. You can plat with each outgoing SMTP server’s settings under the Server Settings and Advanced tabs.
If you have one working iCloud server, and the other is broken, compare its settings and make them match. You may need to uncheck ‘Automatic…’ to expose the necessary fields.
If you’re still having trouble, post screenshots and messages.