Email test failed when through proxy

I’m routing SMTP through a proxy in a container.
I can confirm email is sent when not routed through proxy.
But when i route through proxy, i see the following logs which are sent in sequence, after 30s of triggering the email send:

Error sending e-mail : timeout occured
send RSET
recv: 220 smtp.mymail.com ESMTP ready
send QUIT
recv: 250 2.0.0 OK

Any clue what could be going wrong?

Locally running this cURL command proxied through the same container, works fine:

curl --ssl smtp://smtp.mymail.com:587 --mail-from id@mymail.com --mail-rcpt test@myrcpt.com --upload-file email.txt --user 'id@mymail.com:password' -v

More info: i can see the test hitting the proxy container, but only as soon as the “timeout occured” message is logged.
It looks like for some reason the actual emailing attempt is done after the timeout is already hit?!