### 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
group = self.inventory.add_group(group)
        if not isinstance(data, dict):
            data = {'hosts': data}
        
        elif not any(k in data for k in ('hosts', 'vars', 'children')):
            data = {'hosts': [group], 'vars': data}
        if 'hosts' in data:
            if not isinstance(data['hosts'], list):
                raise AnsibleError("You defined a group '%s' with bad data for the host list:\n %s" % (group, data))
            for hostname in data['hosts']:
                self._hosts.add(hostname)
                self.inventory.add_host(hostname, group)
        if 'vars' in data:
            if not isinstance(data['vars'], dict):
                raise AnsibleError("You defined a group '%s' with bad data for variables:\n %s" % (group, data))
            for k, v in data['vars'].items():
                self.inventory.set_variable(group, k, v)
        if group != '_meta' and isinstance(data, dict) and 'children' in data:
            for child_name in data['children']:
                child_name = self.inventory.add_group(child_name)
                self.inventory.add_child(group, child_name)
    def get_host_variables(self, path, host):