### 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
exc_msg = display.get_deprecation_message(warning_text, version=removal_version, date=removal_date,
                                                              collection_name=acr.collection, removed=True)
                    raise AnsiblePluginRemovedError(exc_msg)
                redirect = routing_entry.get('redirect', None)
                if redirect:
                    next_key, leaf_key = get_fqcr_and_name(redirect, collection=acr.collection)
                    display.vvv('redirecting (type: {0}) {1}.{2} to {3}'.format(self._dirname, acr.collection, acr.resource, next_key))
                    key = next_key
                else:
                    break
            func = self._collection_jinja_func_cache.get(key)
            if func:
                return func
            try:
                pkg = import_module(acr.n_python_package_name)
            except ImportError:
                raise KeyError()
            parent_prefix = acr.collection
            if acr.subdirs:
                parent_prefix = '{0}.{1}'.format(parent_prefix, acr.subdirs)
            
            for dummy, module_name, ispkg in pkgutil.iter_modules(pkg.__path__, prefix=parent_prefix + '.'):
                if ispkg:
                    continue
                try:
                    plugin_impl = self._pluginloader.get(module_name)
                except Exception as e:
                    raise TemplateSyntaxError(to_native(e), 0)
                try:
                    method_map = getattr(plugin_impl, self._method_map_name)