I’ve done tons of terminal automations and haven’t seen this error one time. I suggest talking to your mainframe admins to see if they can tell you what the error means and what is causing it. It could be something to do with the way you have your connection configured, emulation, etc.
Is it happening always at the same activity or is it changing for each execution?
Also can you please confirm enough delay is provided in the workflow.
If it is failing at any random activity of Mainframe, then increase timeout from 300 MS to 1000MSat each activity .
If Mainframe is disabled at particular index and BOT is trying to send keys at that coordinates. then It is throwing this error: Keyboard Locked. I have handle this exception but, the problem is after handle it in try catch, in other terminal activity it is throwing Timeout error. This looks like bug with UiPath emulator Direct Connect. Because it works fine with other third party emulator.