### Summary

Copied from amazon.aws https://github.com/ansible-collections/amazon.aws/issues/633

https://github.com/ansible/ansible/pull/75587 appears to have broken amazon.aws.lookup_aws_account_attribute when running wantlist=False

### Issue Type

Bug Report

### Component Name

lib/ansible/template/__init__.py

### Ansible Version

```console
$ ansible --version
ansible [core 2.14.0.dev0] (devel f75bb09a8b) last updated 2022/05/12 17:31:50 (GMT -400)
  config file = None
  configured module search path = ['/home/josephtorcasso/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/josephtorcasso/633/ansible/lib/ansible
  ansible collection location = /home/josephtorcasso/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/josephtorcasso/633/venv/bin/ansible
  python version = 3.10.4 (main, Mar 25 2022, 00:00:00) [GCC 11.2.1 20220127 (Red Hat 11.2.1-9)] (/home/josephtorcasso/633/venv/bin/python3)
  jinja version = 3.1.2
  libyaml = True
```


### Configuration

```console
$ ansible-config dump --only-changed
```


### OS / Environment

Fedora 35

### Steps to Reproduce

<!--- Paste example playbooks or commands between quotes below -->
Running integration tests for ansible.aws lookup_aws_account_attribute

### Expected Results

Expected tests to pass using wantlist=False

### Actual Results

```console
TASK [lookup_aws_account_attribute : Fetch all account attributes (wantlist=False)] *******************************************************************************************************************************
task path: /root/ansible_collections/amazon/aws/tests/output/.tmp/integration/lookup_aws_account_attribute-bjtiq49h-ÅÑŚÌβŁÈ/tests/integration/targets/lookup_aws_account_attribute/tasks/main.yaml:50
The full traceback is:
Traceback (most recent call last):
  File "/root/ansible/lib/ansible/executor/task_executor.py", line 503, in _execute
    self._task.post_validate(templar=templar)
  File "/root/ansible/lib/ansible/playbook/task.py", line 283, in post_validate
    super(Task, self).post_validate(templar)
  File "/root/ansible/lib/ansible/playbook/base.py", line 650, in post_validate
    value = templar.template(getattr(self, name))
  File "/root/ansible/lib/ansible/template/__init__.py", line 874, in template
    d[k] = self.template(
  File "/root/ansible/lib/ansible/template/__init__.py", line 842, in template
    result = self.do_template(
  File "/root/ansible/lib/ansible/template/__init__.py", line 1101, in do_template
    res = ansible_concat(rf, convert_data, myenv.variable_start_string)
  File "/root/ansible/lib/ansible/template/native_helpers.py", line 60, in ansible_concat
    head = list(islice(nodes, 2))
  File "<template>", line 13, in root
  File "/usr/lib/python3.10/dist-packages/jinja2/runtime.py", line 349, in call
    return __obj(*args, **kwargs)
  File "/root/ansible/lib/ansible/template/__init__.py", line 1013, in _lookup
    if isinstance(ran[0], NativeJinjaText):
KeyError: 0
fatal: [testhost]: FAILED! => {
    "changed": false
}
```


### Code of Conduct

- [X] I agree to follow the Ansible Code of Conduct
key, leaf_key = get_fqcr_and_name(key)
            seen = set()
            while True:
                if key in seen:
                    raise TemplateSyntaxError(
                        'recursive collection redirect found for %r' % original_key,
                        0
                    )
                seen.add(key)
                acr = AnsibleCollectionRef.try_parse_fqcr(key, self._dirname)
                if not acr:
                    raise KeyError('invalid plugin name: {0}'.format(key))
                ts = _get_collection_metadata(acr.collection)
                
                routing_entry = ts.get('plugin_routing', {}).get(self._dirname, {}).get(leaf_key, {})
                deprecation_entry = routing_entry.get('deprecation')
                if deprecation_entry:
                    warning_text = deprecation_entry.get('warning_text')
                    removal_date = deprecation_entry.get('removal_date')
                    removal_version = deprecation_entry.get('removal_version')
                    if not warning_text:
                        warning_text = '{0} "{1}" is deprecated'.format(self._dirname, key)
                    display.deprecated(warning_text, version=removal_version, date=removal_date, collection_name=acr.collection)
                tombstone_entry = routing_entry.get('tombstone')
                if tombstone_entry:
                    warning_text = tombstone_entry.get('warning_text')
                    removal_date = tombstone_entry.get('removal_date')
                    removal_version = tombstone_entry.get('removal_version')
                    if not warning_text:
                        warning_text = '{0} "{1}" has been removed'.format(self._dirname, key)