I've only seen this error one time and it was during the "Inject Script" part of my template in which I was trying to inject my Sysprep.inf. The cause ended up being an incorrect path in the Action. I was trying to point the sysprep.inf file to "c:\sysprep\sysprep.inf" but because of an odd mapping propblem, the OS was residing on the D drive instead of C.
That being said, check your paths in your task, particularly where you're pulling the image from. Also, after the task fails, open a new console window in WinPE and see if you can browse to the drive containing the OS your writing over. Does everything look ok there?
You mentioned that you're making some partition changes. Maybe something isn't working right there and is causing the inability to lay the image down.
Hope this helps.