Not able to run the bot properly due to click event

Hi Team,
I am running one process flow but something it is working properly and sometimes it is failing because of click event and “desktop has been disconnected while performing this UI action” error.
please suggest me what needs to be done. And I have double checked also the selectors are dynamic (no ids has been added).so I have changed some of the click event to image click but sometimes it worked again failed.