### Summary

When I do {% import %} in some jinja template and that imported template contains errors or raises an exception, it is just ignored. Before 2.13 I saw the error when running the playbook with the exception from the imported template. With 2.13 it is just ignored and everything is green. At least such mistakes are ignored: `{{ _undefined_name }}`, `{{ {}['missing_attribute'] }}`, but division on zero still yields an error: `{{ 0/0 }}`.
I tried different combinations of ansible 2.12 & 2.13 with jinja2 3.0 & 3.1. The problem arises only with ansible 2.13 with both jinja versions.

### Issue Type

Bug Report

### Component Name

jinja2

### Ansible Version

```console
$ ansible --version
ansible [core 2.13.1]
  config file = /home/user/.ansible.cfg
  configured module search path = ['/home/user/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/user/soft/ansible-test-2.13.1/lib/python3.10/site-packages/ansible
  ansible collection location = /home/user/.ansible/collections:/usr/share/ansible/collections
  executable location = ./bin/ansible
  python version = 3.10.5 (main, Jun  8 2022, 02:00:39) [GCC 10.2.1 20201203]
  jinja version = 3.1.2
  libyaml = True
```


### Configuration

```console
# if using a version older than ansible-core 2.12 you should omit the '-t all'
$ ansible-config dump --only-changed -t all
```


### OS / Environment

Void Linux

### Steps to Reproduce

<!--- Paste example playbooks or commands between quotes below -->
```yaml (paste below)
---

- hosts: localhost
  connection: local
  tasks:

  - name: test
    template:
      dest: "test.txt"
      src: test1.j2
```

test1.j2:
```
{% import 'test2.j2' as t %}
```

test2.j2:
```
{{ _error }}
{{ {}["error"] }}
```

### Expected Results

With ansible 2.12 I get an error:
```
TASK [test] ********************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ansible.errors.AnsibleUndefinedVariable: '_error' is undefined
fatal: [localhost]: FAILED! => {"changed": false, "msg": "AnsibleUndefinedVariable: '_error' is undefined"}
```

### Actual Results

```console
$ ansible-playbook -CD test.yml 
[WARNING]: No inventory was parsed, only implicit localhost is available
[WARNING]: provided hosts list is empty, only localhost is available. Note that
the implicit localhost does not match 'all'

PLAY [localhost] ***************************************************************

TASK [Gathering Facts] *********************************************************
ok: [localhost]

TASK [test] ********************************************************************
--- before
+++ after: /home/user/.ansible/tmp/ansible-local-17138l0v8fvxh/tmpla8gx7_o/test1.j2
@@ -0,0 +1 @@
+

changed: [localhost]

PLAY RECAP *********************************************************************
localhost                  : ok=2    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
```


### Code of Conduct

- [X] I agree to follow the Ansible Code of Conduct
'''
        Our helper function, which will also recursively check dict and
        list entries due to the fact that they may be repr'd and contain
        a key or value which contains jinja2 syntax and would otherwise
        lose the AnsibleUnsafe value.
        '''
        if isinstance(val, dict):
            for key in val.keys():
                if self._is_unsafe(val[key]):
                    return True
        elif isinstance(val, list):
            for item in val:
                if self._is_unsafe(item):
                    return True
        elif getattr(val, '__UNSAFE__', False) is True:
            return True
        return False
    def _update_unsafe(self, val):
        if val is not None and not self.unsafe and self._is_unsafe(val):
            self.unsafe = True
    def resolve(self, key):
        '''
        The intercepted resolve(), which uses the helper above to set the
        internal flag whenever an unsafe variable value is returned.
        '''
        val = super(AnsibleContext, self).resolve(key)
        self._update_unsafe(val)
        return val
    def resolve_or_missing(self, key):