Great blog post about a similar issue we were having in production.
Instances where application will not install after a reboot. Even when the logs say they installed correctly. We found this was more likely to happen on devices with SSD compared to SATA drives.
Looks like a know bug, but nothing a sleep command can solve: http://www.bctechnet.com/install-application-step-fails-in-task-sequence/