### Summary

I am developing modules using the latest stable versions of Ansible on either Python 3.8 or 3.9. Both versions are giving errors. 

### Issue Type

Bug Report

### Component Name

ansible

### Ansible Version

```console
ansible [core 2.12.0]
  config file = /Users/kbreit/Documents/Programming/ansible_collections/cisco/meraki/ansible.cfg
  configured module search path = ['/Users/kbreit/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /Users/kbreit/.pyenv/versions/3.9.7/envs/ansible-development-latest/lib/python3.9/site-packages/ansible
  ansible collection location = /Users/kbreit/.ansible/collections:/usr/share/ansible/collections
  executable location = /Users/kbreit/.pyenv/versions/ansible-development-latest/bin/ansible
  python version = 3.9.7 (default, Nov  7 2021, 06:44:13) [Clang 12.0.5 (clang-1205.0.22.9)]
  jinja version = 3.0.3
  libyaml = True
```


### Configuration

```console
DEFAULT_VAULT_PASSWORD_FILE(env: ANSIBLE_VAULT_PASSWORD_FILE) = /Users/kbreit/pass.txt
GALAXY_SERVER_LIST(/Users/kbreit/Documents/Programming/ansible_collections/cisco/meraki/ansible.cfg) = ['automation_hub']
```


### OS / Environment

macOS and Ubuntu 21.04

### Steps to Reproduce

Reproducing it largely depends on ansible-test. However...

<!--- Paste example playbooks or commands between quotes below -->
```yaml (paste below)
(ansible-development-latest) meraki [master●●] % ansible-test network-integration --allow-unsupported --python 3.9 --docker default meraki_network
```


### Expected Results

I expect the `meraki_network` module (or whatever module I'm testing) to execute in full.

### Actual Results

```console
Starting new "ansible-test-controller-pVmIMX5s" container.
Adding "ansible-test-controller-pVmIMX5s" to container database.
NOTICE: Sourcing inventory file "tests/integration/inventory.networking" from "/Users/kbreit/Documents/Programming/ansible_collections/cisco/meraki/tests/integration/inventory.networking".
Traceback (most recent call last):
  File "/root/ansible/bin/ansible-test", line 42, in <module>
    main()
  File "/root/ansible/bin/ansible-test", line 33, in main
    cli_main()
  File "/root/ansible/test/lib/ansible_test/_internal/__init__.py", line 70, in main
    args.func(config)
  File "/root/ansible/test/lib/ansible_test/_internal/commands/integration/network.py", line 73, in command_network_integration
    command_integration_filtered(args, host_state, internal_targets, all_targets, inventory_path)
  File "/root/ansible/test/lib/ansible_test/_internal/commands/integration/__init__.py", line 458, in command_integration_filtered
    create_inventory(args, host_state, inventory_path, target)
  File "/root/ansible/test/lib/ansible_test/_internal/commands/integration/__init__.py", line 382, in create_inventory
    create_network_inventory(args, inventory_path, target_profiles)
  File "/root/ansible/test/lib/ansible_test/_internal/inventory.py", line 90, in create_network_inventory
    shutil.copyfile(first.config.path, path)
  File "/usr/lib/python3.9/shutil.py", line 243, in copyfile
    if _samefile(src, dst):
  File "/usr/lib/python3.9/shutil.py", line 220, in _samefile
    return os.path.samefile(src, dst)
  File "/usr/lib/python3.9/genericpath.py", line 100, in samefile
    s1 = os.stat(f1)
TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType
ERROR: Command "docker exec -it ansible-test-controller-pVmIMX5s /usr/bin/env ANSIBLE_TEST_CONTENT_ROOT=/root/ansible_collections/cisco/meraki LC_ALL=en_US.UTF-8 /usr/bin/python3.9 /root/ansible/bin/ansible-test network-integration --containers '{}' --allow-unsupported meraki_network --metadata tests/output/.tmp/metadata-os7__ecv.json --truncate 137 --color yes --host-path tests/output/.tmp/host-_fjd92yd" returned exit status 1.
```


### Code of Conduct

- [X] I agree to follow the Ansible Code of Conduct
"""Return the inventory path used for the given integration configuration relative to the content root."""
    inventory_names = {
        PosixIntegrationConfig: 'inventory',
        WindowsIntegrationConfig: 'inventory.winrm',
        NetworkIntegrationConfig: 'inventory.networking',
    }  
    return os.path.join(data_context().content.integration_path, inventory_names[type(args)])
def delegate_inventory(args, inventory_path_src):  
    """Make the given inventory available during delegation."""
    if isinstance(args, PosixIntegrationConfig):
        return
    def inventory_callback(files):  
        """
        Add the inventory file to the payload file list.
        This will preserve the file during delegation even if it is ignored or is outside the content and install roots.
        """
        inventory_path = get_inventory_relative_path(args)
        inventory_tuple = inventory_path_src, inventory_path
        if os.path.isfile(inventory_path_src) and inventory_tuple not in files:
            originals = [item for item in files if item[1] == inventory_path]
            if originals:
                for original in originals:
                    files.remove(original)
                display.warning('Overriding inventory file "%s" with "%s".' % (inventory_path, inventory_path_src))
            else:
                display.notice('Sourcing inventory file "%s" from "%s".' % (inventory_path, inventory_path_src))
            files.append(inventory_tuple)
    data_context().register_payload_callback(inventory_callback)
@contextlib.contextmanager
def integration_test_environment(