### Summary

When the. in my case Python, script --host [inventory_host] raises an error it's doesn't catch on exception treatment as it is don on --list

I already made a fix and will create a PR to fix it.

### Issue Type

Bug Report

### Component Name

lib/ansible/plugins/inventory/script.py

### Ansible Version

```console
$ ansible --version
ansible [core 2.13.10]
  config file = None
  configured module search path = ['/home/rundeck/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/rundeck/.local/lib/python3.8/site-packages/ansible
  ansible collection location = /home/rundeck/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/rundeck/.local/bin/ansible
  python version = 3.8.10 (default, Jun 22 2022, 20:18:18) [GCC 9.4.0]
  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
Empty
```


### OS / Environment

NAME="Ubuntu"
VERSION="20.04.5 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.5 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal

### Steps to Reproduce

- hosts: all
  gather_facts: false
  tasks:
   - win_ping:

### Expected Results

When the Inventory script ends with status code different than 0, the stderr must be printed as an Warning on the playbook execution

```
ansible-playbook [core 2.13.10]
  config file = None
  configured module search path = ['/home/rundeck/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/rundeck/.local/lib/python3.8/site-packages/ansible
  ansible collection location = /home/rundeck/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/rundeck/.local/bin/ansible-playbook
  python version = 3.8.10 (default, Jun 22 2022, 20:18:18) [GCC 9.4.0]
  jinja version = 3.1.2
  libyaml = True
No config file found; using defaults
setting up inventory plugins
host_list declined parsing /home/rundeck/server/data/ansible/inventory.py as it did not pass its verify_file() method
auto declined parsing /home/rundeck/server/data/ansible/inventory.py as it did not pass its verify_file() method
toml declined parsing /home/rundeck/server/data/ansible/inventory.py as it did not pass its verify_file() method
```
**[WARNING]:  * Failed to parse /home/rundeck/server/data/ansible/inventory.py with script plugin: Inventory script (/home/rundeck/server/data/ansible/inventory.py) had an execution error: Error
while retrieving password from Password Safe**
```
  File "/home/rundeck/.local/lib/python3.8/site-packages/ansible/inventory/manager.py", line 290, in parse_source
    plugin.parse(self._inventory, self._loader, source, cache=cache)
  File "/home/rundeck/.local/lib/python3.8/site-packages/ansible/plu

```

### Actual Results

```console
ansible-playbook [core 2.13.10]
  config file = None
  configured module search path = ['/home/rundeck/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/rundeck/.local/lib/python3.8/site-packages/ansible
  ansible collection location = /home/rundeck/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/rundeck/.local/bin/ansible-playbook
  python version = 3.8.10 (default, Jun 22 2022, 20:18:18) [GCC 9.4.0]
  jinja version = 3.1.2
  libyaml = True
No config file found; using defaults
setting up inventory plugins
host_list declined parsing /home/rundeck/server/data/ansible/intel as it did not pass its verify_file() method
auto declined parsing /home/rundeck/server/data/ansible/intel as it did not pass its verify_file() method
toml declined parsing /home/rundeck/server/data/ansible/intel as it did not pass its verify_file() method
[WARNING]:  * Failed to parse /home/rundeck/server/data/ansible/intel with script plugin: Invalid data from file, expected dictionary and got:  None
  File "/home/rundeck/.local/lib/python3.8/site-packages/ansible/inventory/manager.py", line 290, in parse_source
    plugin.parse(self._inventory, self._loader, source, cache=cache)
  File "/home/rundeck/.local/lib/python3.8/site-packages/ansible/plugins/inventory/script.py", line 149, in parse
    raise AnsibleParserError(to_native(e))
```


### Code of Conduct

- [X] I agree to follow the Ansible Code of Conduct
if stderr and self.get_option('always_show_stderr'):
                self.display.error(msg=to_text(err))
            if not isinstance(processed, Mapping):
                raise AnsibleError("failed to parse executable inventory script results from {0}: needs to be a json dict\n{1}".format(path, err))
            group = None
            data_from_meta = None
            
            
            
            
            for (group, gdata) in processed.items():
                if group == '_meta':
                    if 'hostvars' in gdata:
                        data_from_meta = gdata['hostvars']
                else:
                    self._parse_group(group, gdata)
            for host in self._hosts:
                got = {}
                if data_from_meta is None:
                    got = self.get_host_variables(path, host)
                else:
                    try:
                        got = data_from_meta.get(host, {})
                    except AttributeError as e:
                        raise AnsibleError("Improperly formatted host information for %s: %s" % (host, to_native(e)), orig_exc=e)
                self._populate_host_vars([host], got)
        except Exception as e:
            raise AnsibleParserError(to_native(e))
    def _parse_group(self, group, data):