RPA Activity not completing action

Hello, I've been facing an issue where, for only 1 specific RPA activity, it frequently (yet randomly) doesn't complete the step in Central, resulting in a 'running' robot but nothing running. 

The activity interacts with SAP to export a bunch of project information on a number of order numbers. Once all extracted and the spreadsheet updated, it should finish the step and move on to the next step in the workflow, a python script to update the new data into Primavera. 

I've been facing this issue for some time, and as it doesn't happen every time, it's been hard to fix. I included logging all throughout the script and the end of the code finishes with a "closed" line in the log, then followed that with an ExitTest statement to force exist. The robot is reaching this step, as I can see the "closed" in the log, and on the robot, there is no script running (if I open UFT it is an empty) but the action in Central stays running. It's causing big headaches as it's essentially locking the robot and license for hours until someone sees it and cancels it manually. We then have to restart the robot or close the uft activity from task manager. 

Has anyone else experienced this? I don't know how else to resolve this 

- log confirms the robot reached the end of the script

- uft on the robot is empty and not running when opened

- in central robot is in running state

- step in the flow is in running state

f.WriteLine("closed")
f.Close
Set f = Nothing
Set fso = nothing
ExitTest