Please check you credentials on your orchestrator as well and when you see this try logging in manually and see if you are seeing the same message. If so then it might be due to cred issue and too many login tries with no success.
I have checked that the credentials are correct. And, as I mentioned in my question, it works sometimes and then stops working after that. May be not able to log out of machine at the end of the process. What could be the problem for bot to not be able to sign out properly?
One more thing, in UiPath assistant I am seeing robot as Connected, Unlicensed even though I have followed all the steps. i am able to see machine as available and also has license assigned to it.
For unattended robots, it is not important what you see in the Assistant. For them, you need to check in the Orchestrator → Tenant → Monitoring → Unattended sessions what is the real status.
Check if in the robot settings in Orchestrator, the robot has LoginToConsole enabled and set it to False. Also, you need to login into the robot machine as the robot user and open a cmd.exe console and run logoff (it will Log out your unattended robot from the system) and then run any required jobs from Orchestrator.
After you logout from the Windows 10 machine from all users, you don’t need to be logged in with any users (they will use the Console sessions).
You need to schedule the job from another computer or mobile device that has access to your Orchestrator.
Also, it looks like the account you are using for the Robot is locked out (may be due to too many unsuccessful login attempts). To make sure this is the issue try logging into the Machine using the same credentials manually & if you see account locked message then unlock the account → it should work.