Usually the reason is that the active partition (i.e. the partition you want to boot from) is not set / not set correctly.
Lord knows how/why that happens (it's incredibly inconsistent), but I've seen it happen. You can work around this by adding a line to your script simply FORCING DISKPART to set a particular partition as active (depends on your OS-image). You should find script-commands for disk-part on Microsoft's pages.
Once you've figured the command-line you need, you just whack it into the script, and you're good to go :).
LANDesk EMEA Technical Lead