Retain only part of a file name and fasta header in fasta directory
I think you're working too hard to capture the uce: expression.
Try
sed -Ee '1s/^.+uce:(uce-[0-9]+).+/\1.unaligned.fasta/' file_glob

to replace the first line content. You may want to add the in-place flag after testing the expression on a few files.
For the mv, use command substitution, which runs the command in a sub-shell and uses the output value as the parameter:
for f in file_glob
do    
    mv -- &quot;$f" "$(echo \&quot;$f\&quot; | sed '...')&quot;
done