TCMD: Problem attaching console

#1
1) I lauch CMD with a .BAT (from another project in my company; sets many environment variables)
2) I run TCC from CMD.
3) I run TCMD and want to attach the console from (1-2).

- If I try (3) to attach after (1), I see the console in TCMD's dialog, but I get an error [Un périphérique attaché au système ne fonctionne pas correctement/A device attached to the system does not work correctly. "AttachConsole"], the console disappears from the task bar, but does not show in a TCMD tab.
- If I try (3) to attach after (2), I even don't see the console in TCMD's dialog.

I don't see if I am doing something wrong, or if I am unwittingly making something worse.

TCC 16.03.54 x64 Windows 7 [Version 6.1.7601]
 
#5
These scripts are copied and/or reused from project to project—I guess nowadays noone knows any more the reasons for writing this. In fact I don't see a reason to run CMD at the end of a script in the first place, even less to START CMD—and the START /B CMD is probably there to avoid flickering with windows.
The broken AttachConsole surprised me, but I understand there is nothing to do about it.