Whenever you encounter and error in your Task Sequence you will see a Task Sequence Error popup.
This message will be shown for 15 minutes by default.
You might first be back after the 15 minutes has passed, and then the machines could be at the login screen.
You actually don’t know if it finished successfully or not, since the error timeout has expired and the machine rebooted.
In order to extend this timeout period you can use the variable SMSTSErrorDialogTimeout
When an error occurs in a task sequence, a dialog box is displayed that is automatically dismissed after a number of seconds specified by this variable. By default, the dialog box is automatically dismissed after 900 seconds (15 minutes)..
You can for example set the variable in your Task Sequence as shown here (86400 = 24 hours):