Automating a DOS/COBOL application

I had an issue double clicking an option from a list in a DOS/COBOL application. I eventually was able to accomplish this by using a Set Focus, then Type Into, then Double Click activities.

However, when the automation moves onto the next workflow or if I comment out everything else and UI Path ends automation at this point, I get a memory out of bounds error (image below). I am not sure how I am causing this error using just points and clicks in the application.