From the perspective of not knowing how these bash scripts were deployed,
it's worth confirming that what we are assuming is the "same bash script" are
indeed exactly identical.
$ cmp script1 script2
If somehow the double quotes in the problem script have become something
other than plain ASCII 0x22 bytes, that could explain the observed behaviour.
Because extended character sets can contain a variety of characters that
visually appear identical to their plain ASCII counterparts. But the shell won't
parse and remove them as quote characters, even though they "look like" quote
characters.