Well the answer to your problem is pretty simple, you are trying to use a delivery server that takes a long time to respond, and your web server times out before the delivery server responds.
You can(and should) use a delivery server that answer faster, like in max 2 seconds, or you can increase your web server timeout period.
None of the above are related to mailwizz app itself
Thanks.