I cannot reproduce what's happening in your codes but I see all is syntaxically fine and working; but here is what you seems are trying to do with shell-loops that you would better to avid it. Below I used awk command alone.
gawk 'ARGIND==2{ strings[$0]; next; };
(substr($0, 2, 5) in strings);
' RS='[[:space:]]+' strings.txt RS='\n' criteria.txt
Here we are reading all strings (split on whitespaces or \newline [[:space:]] in "strings.txt" file into an awk associated array (we name it strings).
The ATGIND==2 controlling the input and to run first block of the code only for the "strings.txt" file and awk will skip running that block for next input(s). see here why we preferred this over more common use of NR==FNR.
when next file "criteria.txt" opened for processing, we set Record Separator to default \newline in RS='\n'; and in (substr($0, 2, 5) in strings) we are checking if the expected substring start from position 2 with character length of 5 exist in our array or not, if it was, then the line will go to output .
Input data:
strings.txt:
CDA01 CDA02
CDA03
CDA03 CDA05 CDA06
criteria.txt:
xCDA01 something
xxCDA02 someotherthing
CDA01
vcCDA03 oCDA03
vCDA05 end
Output:
xCDA01 something
vCDA05 end