Important detail, when you say you run the workflow when VDI is open and it is working, do you use system tray or Studio?
in case you would be using studio, very likely what could be happening is that you are saving the screenshot using a relative path (.screenshot\untitled.png). When you are running it from studio, it will save the screenshot on the project location as it is the current context of the workflow execution.
However when you publish your project and trigger it from orchestrator or system tray, the context will become the package is stored after it is synced with the orchestrator (on 2017.1 it will be attempted to be as saved %programdata\UiPath%ProjectName&Version\lib\net45\untiltled.png and fail because you cannot save file at this location.
A simple way to spot the location for a relativepath is to log something like under
if you do not have any try catch, running from the system tray should be showing your an error related to the path.
If you do not use relative path you have no error occuring from system tray with TryCatch, the problem is elsewhere