### Summary

Given I have installed GalaxyNG and published custom content and synchronized content from galaxy.ansible.com, when I try to install collections listed in a `requirements.yml` via a modern version of `ansible-galaxy` configured to use GalaxyNG, `ansible-galaxy` fails when encountering the `community.vmware` collection.  

If you comment out `community.vmware` from `requirements.yml`, all other collections (custom published and synchronized) install fine.

If you uncomment `community.vmware` and use an older version of `ansible-galaxy` (e.g., Ansible 2.9.12), all collections install fine.

### Issue Type

Bug Report

### Component Name

ansible-galaxy

### Ansible Version

```console
$ ansible --version

# works (Ansible 2.9.12 installed via pip)
ansible 2.9.12
  config file = /home/ben/workspace/kiewit/ansible/playbooks/ap_foo/ansible.cfg
  configured module search path = ['/home/ben/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/ben/venv3_ansible-2.9.12/lib/python3.8/site-packages/ansible
  executable location = /home/ben/venv3_ansible-2.9.12/bin/ansible
  python version = 3.8.10 (default, Mar 15 2022, 12:22:08) [GCC 9.4.0]

# fails (Ansible 4.2.0 installed via pip)
ansible [core 2.11.2] 
  config file = /home/ben/workspace/kiewit/ansible/playbooks/ap_foo/ansible.cfg
  configured module search path = ['/home/ben/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/ben/venv3_ansible-4.2.0/lib/python3.8/site-packages/ansible
  ansible collection location = /home/ben/workspace/kiewit/ansible/playbooks/ap_foo/collections:/home/ben/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/ben/venv3_ansible-4.2.0/bin/ansible
  python version = 3.8.10 (default, Mar 15 2022, 12:22:08) [GCC 9.4.0]
  jinja version = 3.0.1
  libyaml = True

# fails (Ansible 5.8.0 installed via pip)
ansible [core 2.12.6]
  config file = /home/ben/workspace/kiewit/ansible/playbooks/ap_foo/ansible.cfg
  configured module search path = ['/home/ben/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/ben/venv3_ansible-5.8.0/lib/python3.8/site-packages/ansible
  ansible collection location = /home/ben/workspace/kiewit/ansible/playbooks/ap_foo/collections:/home/ben/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/ben/venv3_ansible-5.8.0/bin/ansible
  python version = 3.8.10 (default, Mar 15 2022, 12:22:08) [GCC 9.4.0]
  jinja version = 3.1.2
  libyaml = True
```


### Configuration

```console
$ ansible-config dump --only-changed -t all
ANSIBLE_NOCOWS(/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/ansible.cfg) = True
CACHE_PLUGIN(/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/ansible.cfg) = jsonfile
CACHE_PLUGIN_CONNECTION(/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/ansible.cfg) = $HOME/ansible/facts
CACHE_PLUGIN_TIMEOUT(/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/ansible.cfg) = 600
CALLBACKS_ENABLED(/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/ansible.cfg) = ['timer', 'profile_roles', 'profile_tasks', 'junit']
COLLECTIONS_PATHS(/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/ansible.cfg) = ['/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/collections', '/home/ben/.ansible/collections', '/usr/share/ansible/col>
DEFAULT_FORKS(/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/ansible.cfg) = 20
DEFAULT_GATHERING(/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/ansible.cfg) = smart
DEFAULT_INVENTORY_PLUGIN_PATH(/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/ansible.cfg) = ['/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/plugins/inventory', '/home/ben/.ansible/plugins/inventory',>
DEFAULT_LOAD_CALLBACK_PLUGINS(/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/ansible.cfg) = True
DEFAULT_ROLES_PATH(/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/ansible.cfg) = ['/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/roles', '/home/ben/.ansible/roles', '/usr/share/ansible/roles', '/etc/>
DEFAULT_STDOUT_CALLBACK(/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/ansible.cfg) = yaml
DEFAULT_VAULT_IDENTITY_LIST(/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/ansible.cfg) = ['vcenter@~/workspace/kiewit/ansible_vaults/vcenter', 'azure@~/workspace/kiewit/ansible_vaults/azure', 'ansible_use>
DEFAULT_VAULT_PASSWORD_FILE(env: ANSIBLE_VAULT_PASSWORD_FILE) = /home/ben/workspace/kiewit/ansible_vaults/molecule
GALAXY_SERVER_LIST(/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/ansible.cfg) = ['kiewit_published', 'kiewit_community']
HOST_KEY_CHECKING(/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/ansible.cfg) = False
INVENTORY_ENABLED(/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/ansible.cfg) = ['host_list', 'script', 'auto', 'yaml', 'ini', 'toml', 'vmware_vm_inventory', 'azure_rm', 'ldap_inventory']
RETRY_FILES_ENABLED(/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/ansible.cfg) = True
VARIABLE_PRECEDENCE(/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/ansible.cfg) = ['all_plugins_inventory', 'groups_plugins_inventory', 'all_inventory', 'groups_inventory', 'all_plugins_play', 'groups_plug>
```


### OS / Environment

Ubuntu 20.04 running Ansible installed via `pip` into a virtual environment.

### Steps to Reproduce

```yaml
---
# requirements.yml

collections:
- name: azure.azcollection
  version: 1.7.0
- name: community.vmware
  version: 1.17.0
- name: community.general
  version: 4.5.0
- name: community.windows
  version: 1.9.0

# custom published collection
- name: kiewit.content
  version: 1.4.0
```

```bash
ansible-galaxy collection install -r collections/requirements.yml -p collections/ -vvvvv --force
```

GalaxyNG installed, custom collection published, remote collections synchronized to GalaxyNG via the following requirements.yml

```yaml
---
collections:
- name: azure.azcollection
- name: community.vmware
- name: community.general
- name: community.windows
```

Notice there are 316 community.vmware versions:

![image](https://user-images.githubusercontent.com/1863643/170338419-bae493ac-3e23-48d7-92ec-442d0dec3b96.png)


### Expected Results

I expect all listed requirements to be forcefully re-installed.

### Actual Results

```console
#
# Failing with `ansible-galaxy` via Ansible 5.8.0
#
ansible-galaxy [core 2.12.6]
  config file = /home/ben/workspace/kiewit/ansible/playbooks/ap_foo/ansible.cfg
  configured module search path = ['/home/ben/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/ben/venv3_ansible-5.8.0/lib/python3.8/site-packages/ansible
  ansible collection location = /home/ben/workspace/kiewit/ansible/playbooks/ap_foo/collections:/home/ben/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/ben/venv3_ansible-5.8.0/bin/ansible-galaxy
  python version = 3.8.10 (default, Mar 15 2022, 12:22:08) [GCC 9.4.0]
  jinja version = 3.1.2
  libyaml = True
Using /home/ben/workspace/kiewit/ansible/playbooks/ap_foo/ansible.cfg as config file
Reading requirement file at '/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/collections/requirements.yml'
Starting galaxy collection install process
Found installed collection azure.azcollection:1.7.0 at '/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/collections/ansible_collections/azure/azcollection'
Found installed collection ansible.windows:1.10.0 at '/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/collections/ansible_collections/ansible/windows'
Found installed collection community.vmware:2.5.0 at '/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/collections/ansible_collections/community/vmware'
Found installed collection community.general:4.5.0 at '/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/collections/ansible_collections/community/general'
Found installed collection community.windows:1.9.0 at '/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/collections/ansible_collections/community/windows'
Found installed collection kiewit.content:1.4.0 at '/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/collections/ansible_collections/kiewit/content'
Process install dependency map
Initial connection to galaxy_server: https://kneawxalp311.kiewitplaza.com/api/galaxy/content/published/
Found API version 'v3' with Galaxy server kiewit_published (https://kneawxalp311.kiewitplaza.com/api/galaxy/content/published/)
Opened /home/ben/.ansible/galaxy_token
Calling Galaxy at https://kneawxalp311.kiewitplaza.com/api/galaxy/content/published/v3/collections/azure/azcollection/
Initial connection to galaxy_server: https://kneawxalp311.kiewitplaza.com/api/galaxy/content/community/
Found API version 'v3' with Galaxy server kiewit_community (https://kneawxalp311.kiewitplaza.com/api/galaxy/content/community/)
Opened /home/ben/.ansible/galaxy_token
Calling Galaxy at https://kneawxalp311.kiewitplaza.com/api/galaxy/content/community/v3/collections/azure/azcollection/
Calling Galaxy at https://kneawxalp311.kiewitplaza.com/api/galaxy/content/published/v3/collections/community/vmware/
Calling Galaxy at https://kneawxalp311.kiewitplaza.com/api/galaxy/content/community/v3/collections/community/vmware/
Calling Galaxy at https://kneawxalp311.kiewitplaza.com/api/galaxy/content/community/v3/collections/community/vmware/versions/?limit=100
Calling Galaxy at https://kneawxalp311.kiewitplaza.com/api/galaxy/content/community/v3/plugin/ansible/content/community/collections/index/community/vmware/versions/?limit=100&offset=100
[WARNING]: Skipping Galaxy server https://kneawxalp311.kiewitplaza.com/api/galaxy/content/community/. Got an unexpected error when getting available versions of collection community.vmware:
'/api/galaxy/content/community/v3/plugin/ansible/content/community/collections/index/community/vmware/versions/'
ERROR! Failed to resolve the requested dependencies map. Could not satisfy the following requirements:
* community.vmware:2.5.0 (direct request)

#
# Working via ansible-galaxy provided in Ansible 2.9.12
#
ansible-galaxy 2.9.12
  config file = /home/ben/workspace/kiewit/ansible/playbooks/ap_foo/ansible.cfg
  configured module search path = ['/home/ben/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/ben/venv3_ansible-2.9.12/lib/python3.8/site-packages/ansible
  executable location = /home/ben/venv3_ansible-2.9.12/bin/ansible-galaxy
  python version = 3.8.10 (default, Mar 15 2022, 12:22:08) [GCC 9.4.0]
Using /home/ben/workspace/kiewit/ansible/playbooks/ap_foo/ansible.cfg as config file
Reading requirement file at '/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/collections/requirements.yml'
Found installed collection azure.azcollection:1.7.0 at '/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/collections/ansible_collections/azure/azcollection'
Found installed collection ansible.windows:1.10.0 at '/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/collections/ansible_collections/ansible/windows'
Found installed collection community.vmware:2.5.0 at '/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/collections/ansible_collections/community/vmware'
Found installed collection community.general:4.5.0 at '/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/collections/ansible_collections/community/general'
Found installed collection community.windows:1.9.0 at '/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/collections/ansible_collections/community/windows'
Found installed collection kiewit.content:1.4.0 at '/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/collections/ansible_collections/kiewit/content'
Process install dependency map
Initial connection to galaxy_server: https://kneawxalp311.kiewitplaza.com/api/galaxy/content/published/
Opened /home/ben/.ansible/galaxy_token
Calling Galaxy at https://kneawxalp311.kiewitplaza.com/api/galaxy/content/published/
Found API version 'v3' with Galaxy server kiewit_published (https://kneawxalp311.kiewitplaza.com/api/galaxy/content/published/)
Calling Galaxy at https://kneawxalp311.kiewitplaza.com/api/galaxy/content/published/v3/collections/azure/azcollection/versions/1.7.0/
Initial connection to galaxy_server: https://kneawxalp311.kiewitplaza.com/api/galaxy/content/community/
Opened /home/ben/.ansible/galaxy_token
Calling Galaxy at https://kneawxalp311.kiewitplaza.com/api/galaxy/content/community/
Processing requirement collection 'azure.azcollection'
Collection requirement 'azure.azcollection' is the name of a collection
Collection 'azure.azcollection' is not available from server kiewit_published https://kneawxalp311.kiewitplaza.com/api/galaxy/content/published/
Found API version 'v3' with Galaxy server kiewit_community (https://kneawxalp311.kiewitplaza.com/api/galaxy/content/community/)
Calling Galaxy at https://kneawxalp311.kiewitplaza.com/api/galaxy/content/community/v3/collections/azure/azcollection/versions/1.7.0/
Calling Galaxy at https://kneawxalp311.kiewitplaza.com/api/galaxy/content/published/v3/collections/community/vmware/versions/2.5.0/
Collection 'azure.azcollection' obtained from server kiewit_community https://kneawxalp311.kiewitplaza.com/api/galaxy/content/community/
Processing requirement collection 'community.vmware'
Collection requirement 'community.vmware' is the name of a collection
Calling Galaxy at https://kneawxalp311.kiewitplaza.com/api/galaxy/content/community/v3/collections/community/vmware/versions/2.5.0/
Collection 'community.vmware' is not available from server kiewit_published https://kneawxalp311.kiewitplaza.com/api/galaxy/content/published/
Calling Galaxy at https://kneawxalp311.kiewitplaza.com/api/galaxy/content/published/v3/collections/community/general/versions/4.5.0/
Collection 'community.vmware' obtained from server kiewit_community https://kneawxalp311.kiewitplaza.com/api/galaxy/content/community/
Processing requirement collection 'community.general'
Collection requirement 'community.general' is the name of a collection
Calling Galaxy at https://kneawxalp311.kiewitplaza.com/api/galaxy/content/community/v3/collections/community/general/versions/4.5.0/
Collection 'community.general' is not available from server kiewit_published https://kneawxalp311.kiewitplaza.com/api/galaxy/content/published/
Calling Galaxy at https://kneawxalp311.kiewitplaza.com/api/galaxy/content/published/v3/collections/community/windows/versions/1.9.0/
Collection 'community.general' obtained from server kiewit_community https://kneawxalp311.kiewitplaza.com/api/galaxy/content/community/
Processing requirement collection 'community.windows'
Collection requirement 'community.windows' is the name of a collection
Calling Galaxy at https://kneawxalp311.kiewitplaza.com/api/galaxy/content/community/v3/collections/community/windows/versions/1.9.0/
Collection 'community.windows' is not available from server kiewit_published https://kneawxalp311.kiewitplaza.com/api/galaxy/content/published/
Calling Galaxy at https://kneawxalp311.kiewitplaza.com/api/galaxy/content/published/v3/collections/kiewit/content/versions/1.4.0/
Collection 'community.windows' obtained from server kiewit_community https://kneawxalp311.kiewitplaza.com/api/galaxy/content/community/
Processing requirement collection 'kiewit.content'
Collection requirement 'kiewit.content' is the name of a collection
Calling Galaxy at https://kneawxalp311.kiewitplaza.com/api/galaxy/content/community/v3/collections/ansible/windows/versions/
Collection 'kiewit.content' obtained from server kiewit_published https://kneawxalp311.kiewitplaza.com/api/galaxy/content/published/
Processing requirement collection 'ansible.windows' - as dependency of community.windows
Collection requirement 'ansible.windows' is the name of a collection
Calling Galaxy at https://kneawxalp311.kiewitplaza.com/api/galaxy/content/community/v3/plugin/ansible/content/community/collections/index/ansible/windows/versions/?limit=10&offset=10
Collection 'ansible.windows' obtained from server kiewit_community https://kneawxalp311.kiewitplaza.com/api/galaxy/content/community/
Starting collection install process
Installing 'azure.azcollection:1.7.0' to '/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/collections/ansible_collections/azure/azcollection'
Downloading https://kneawxalp311.kiewitplaza.com/api/galaxy/v3/plugin/ansible/content/community/collections/artifacts/azure-azcollection-1.7.0.tar.gz to /home/ben/.ansible/tmp/ansible-local-20811912wtbig7j/tmp7pjnjmnu
Validating downloaded file hash 28041b95da141c55e01cc491f004b64cd9a7c7d2d28e622825543309744f689a with expected hash 28041b95da141c55e01cc491f004b64cd9a7c7d2d28e622825543309744f689a
Installing 'community.vmware:2.5.0' to '/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/collections/ansible_collections/community/vmware'
Downloading https://kneawxalp311.kiewitplaza.com/api/galaxy/v3/plugin/ansible/content/community/collections/artifacts/community-vmware-2.5.0.tar.gz to /home/ben/.ansible/tmp/ansible-local-20811912wtbig7j/tmp7pjnjmnu
Validating downloaded file hash 4e3aaabdf4802af8ba9c08c77e464c1e0a52abcd7dec7d3aa51b1f865eadfe2a with expected hash 4e3aaabdf4802af8ba9c08c77e464c1e0a52abcd7dec7d3aa51b1f865eadfe2a
Installing 'community.general:4.5.0' to '/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/collections/ansible_collections/community/general'
Downloading https://kneawxalp311.kiewitplaza.com/api/galaxy/v3/plugin/ansible/content/community/collections/artifacts/community-general-4.5.0.tar.gz to /home/ben/.ansible/tmp/ansible-local-20811912wtbig7j/tmp7pjnjmnu
Validating downloaded file hash c191817d1c19fef2ec2927d65dbec65f3f0bbba60523b95ec163a48ba39dbcf0 with expected hash c191817d1c19fef2ec2927d65dbec65f3f0bbba60523b95ec163a48ba39dbcf0
Installing 'community.windows:1.9.0' to '/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/collections/ansible_collections/community/windows'
Downloading https://kneawxalp311.kiewitplaza.com/api/galaxy/v3/plugin/ansible/content/community/collections/artifacts/community-windows-1.9.0.tar.gz to /home/ben/.ansible/tmp/ansible-local-20811912wtbig7j/tmp7pjnjmnu
Validating downloaded file hash 63909e16fc055e39266127098f7c11e9da5e6000b231be5bdac74c1758ef9e9b with expected hash 63909e16fc055e39266127098f7c11e9da5e6000b231be5bdac74c1758ef9e9b
Installing 'kiewit.content:1.4.0' to '/home/ben/workspace/kiewit/ansible/playbooks/ap_foo/collections/ansible_collections/kiewit/content'
Downloading https://kneawxalp311.kiewitplaza.com/api/galaxy/v3/plugin/ansible/content/published/collections/artifacts/kiewit-content-1.4.0.tar.gz to /home/ben/.ansible/tmp/ansible-local-20811912wtbig7j/tmp7pjnjmnu
Validating downloaded file hash 5c72fee203e0e927ab7451cd0d7206c549f4280208f464ec0d5078711c70beda with expected hash 5c72fee203e0e927ab7451cd0d7206c549f4280208f464ec0d5078711c70beda
Skipping 'ansible.windows' as it is already installed
```


### Code of Conduct

- [X] I agree to follow the Ansible Code of Conduct
"""
        Fetch the list of related items for the given role.
        The url comes from the 'related' field of the role.
        """
        results = []
        try:
            url = _urljoin(self.api_server, self.available_api_versions['v1'], "roles", role_id, related,
                           "?page_size=50")
            data = self._call_galaxy(url)
            results = data['results']
            done = (data.get('next_link', None) is None)
            
            
            url_info = urlparse(self.api_server)
            base_url = "%s://%s/" % (url_info.scheme, url_info.netloc)
            while not done:
                url = _urljoin(base_url, data['next_link'])
                data = self._call_galaxy(url)
                results += data['results']
                done = (data.get('next_link', None) is None)
        except Exception as e:
            display.warning("Unable to retrieve role (id=%s) data (%s), but this is not fatal so we continue: %s"
                            % (role_id, related, to_text(e)))
        return results
    @g_connect(['v1'])
    def get_list(self, what):