This can return an array so you probably need to update it to this:

INSTANCE_NAMES=($(get_instances_by_name $NAME_TAG))