In your showing script, you are using
coord.push('A${i}')In this case,
coord has
["A${i}","A${i}",,,]I think that this is the reason for your issue of "Exception: Range not found".
In this case, please modify
coord.push('A${i}') to
coord.push(`A${i}`) and test it again.
Ref