zsh for-loop erroneously expanding file extension

I've been using a bash for-loop for a bioinformatics project without problem until a few days ago, then it suddenly stopped working. I'm on OSX V12.1.

Command:

for FILE in ls *.fasta
do
F=$(basename "$FILE".fasta) COMMAND -f "$F".input -o "$F".output
done

It's a very simple for-loop, but starting three days ago, it started iterating over the file extension and giving this error:

File/Path Error: No such file: 'FILE.fasta.fasta'

I'm not sure what the issue is. I've tried unsetting both F and FILE, but that hasn't worked. I've done the old 'turn everything off and back on', which also didn't work. I've done my best to scour the internet for a solution, but I may be missing the correct terminology because I've come up empty.

zsh for-loop erroneously expanding file extension
 
 
Q