### 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
NetworkRemoteConfig,
)
def command_network_integration(args):  
    """Entry point for the `network-integration` command."""
    handle_layout_messages(data_context().content.integration_messages)
    inventory_relative_path = get_inventory_relative_path(args)
    template_path = os.path.join(ANSIBLE_TEST_CONFIG_ROOT, os.path.basename(inventory_relative_path)) + '.template'
    if issubclass(args.target_type, NetworkInventoryConfig):
        inventory_path = os.path.join(data_context().content.root, data_context().content.integration_path,
                                      args.only_target(NetworkInventoryConfig).path or os.path.basename(inventory_relative_path))
    else:
        inventory_path = os.path.join(data_context().content.root, inventory_relative_path)
    if args.no_temp_workdir:
        
        inventory_exists = os.path.exists(inventory_path)
    else:
        inventory_exists = os.path.isfile(inventory_path)
    if not args.explain and not issubclass(args.target_type, NetworkRemoteConfig) and not inventory_exists:
        raise ApplicationError(
            'Inventory not found: %s\n'
            'Use --inventory to specify the inventory path.\n'
            'Use --platform to provision resources and generate an inventory file.\n'
            'See also inventory template: %s' % (inventory_path, template_path)
        )
    check_inventory(args, inventory_path)
    delegate_inventory(args, inventory_path)
    all_targets = tuple(walk_network_integration_targets(include_hidden=True))
    host_state, internal_targets = command_integration_filter(args, all_targets)
    command_integration_filtered(args, host_state, internal_targets, all_targets, inventory_path)