Estou desenvolvendo uma janela com TWindow, quando executo a função diretamente sem abrir o sistema, a janela funciona normalmente, porém quando executo a função chamando com o sistema aberto através de uma menu ou dentro de outra rotina o sistema fecha imediatamente e no console.log aparece o erro abaixo:
2020-11-12T14:00:49.168000-03:00 62004|[12/11/2020 14:00:49][thread 62004] tMsgManager - Timeout waiting for data. [MS_RETURN | BIT_END | BIT_COMMIT]
2020-11-12T14:00:49.171000-03:00 62004| [WARN ][SERVER] [THROW][Thread 62004] tConnnErrorException (8:Communication error: Sync error) on D:\bamboo\xml-data\build-dir\TP11-TECX17V3R1-TECXWIN64\lib_comm\msgmanager.cpp:472
2020-11-12T14:00:49.198000-03:00 62004| [WARN ][SERVER] [Thread 62004] [12/11/2020 14:00:49] Error ending thread (efdeiasoliveira, ENLAVTIC-116N) Communication error: Sync error
2020-11-12T14:00:54.164000-03:00 57540|[MPPORT] 201112_140054 E0C4 BPC2019 W x 05 ctx:111 expired timeout for closing of client connection seconds=5 o1r1R0s0S0
2020-11-12T14:01:08.036000-03:00 56068|Session [P12_EFDEIAS] not found in appserver.ini. Verify the "Environment in the Server"
2020-11-12T14:01:08.036000-03:00 56068| [FATAL][SERVER] 12/11/2020 14:01:08[Thread 56068] [THROW] Session [P12_EFDEIAS] not found in appserver.ini. Verify the "Environment in the Server" at file D:\bamboo\xml-data\build-dir\TP11-TECX17V3R1-TECXWIN64\lib\config.cpp line 98