What edition of SQL server are you using?
I run the same job on a standard edition using Ola's scripts and the job often fails but because I'm rebuilding offline and with a lower priority for the rebuild process. I don't mind it because I've increased the retry attempts and on the second try it passes successfully.
Try retry.
Igor Micev,My blog: www.igormicev.com