Jelena -
One possibility is that something might be corrupting memory and when running the CVI steps externally, the corruption does not affect the sequence editor, OI or TestStand engine, so the error does not occur.
If the error usually occurs after calling a specific step it is good to review how TestStand is configured to call the code module. If you have access to the source code of this step's code module, it is recommended to do a code review of the code itself. If this does not find anything, try to simplify the scenario by slowly removing TestStand steps and pair down the source code to try to isolate what might be causing the problem.
This type of intermittent error is always difficult to isolate.
Scott Richardson
https://testeract.com