I wonder if it’s a TLS vs SSL issue:
587 works, but 465 doesn’t, but in Sonarr (and .net) it’s referred to as SSL, not TLS.
Are you connecting to a public SMTP server or your own?
I wouldn’t rule it out, easiest way test would be testing the connection from Sonarr running on Windows.