Note that the last line of the results of 3dinfo for a resulting bad mprage file is:
Dataset created via: @auto_tlrc -base TT_N27+tlrc -input S06_MPRAGE+orig -no_ss
and the last 3 lines for a good mprage are:
Dataset created via: @auto_tlrc -base TT_N27+tlrc -input S38_MPRAGE+orig -no_ss
3drefit -view +tlrc __ats_tmp___upad40_S38_MPRAGE+orig.HEAD
3drefit -wset S38_MPRAGE+orig __ats_tmp___upad40_S38_MPRAGE+tlrc
It's not clear why the __ats_tmp___upad40_S38_MPRAGE+tlrc dataset is created sometimes, but not other times.