It is because of the start-up proc you have defined. I am sure you want that proc to be an tps_outbound procedure.
The way stope oart-up procs work is when they are active it is as if the thread does not exist. Once you are done you throw the “magic switch”, actually a Tcl command and then it as if the start-up proc does not exist.
I am sure if you remove that proc your connection will work.
I hope you are also aware, the way it is set up, the connection will be made only when a message is present and then disconnect after the message is sent