I agree with Josh on this... The error being produced is from
FSL's flirt, so you should probably check with them...
I will say that this script is somewhat problematic in the following ways:
1) you're using 3dvolreg with the -tshift option, which is convenient but you probably also should to slice timing correction in 3dTshift in case your file doesn't have the slice information.
2) The reorientation of the image after calculating motion might cause havoc in later applying the matrix, particularly when crossing softwares
Since you asked the question on the AFNI message board, I'll be happy to also say that our tools can do this entire process for you as well using
3dAllineate instead of Flirt. Or you could make use of our superscript
afni_proc.py to fully process your data and thanks to the <insert great adjectives here> Paul Taylor and others, get very pretty QC images at the end of it.
A full introduction to AFNI can be found on YouTube. And of course we're here to help.