I suspect you have the update environment directive set. From the docs:
Update Environment on System Change : If enabled, TCC will monitor the WM_SETTINGCHANGE message and if the environment is specified, update the environment from the User, Volatile, and System registry entries. The updates are done whenever TCC displays a prompt (to prevent the environment from changing in the middle of a batch file). Unless you have a specific need for this option it's better not to enable it, as it can result in variables set by TCC's parent process being destroyed.