### Summary

When an Ansible control node running Ubuntu 20.04 attempts to gather facts from itself with `ansible.builtin.gather_facts` using the latest devel branch of ansible-core, the module fails with a traceback. ansible-core 2.13.0 is affected by this issue as well. 2.12.5 is not affected by this issue.

### Issue Type

Bug Report

### Component Name

gather_facts

### Ansible Version

```console
(venv) christopher@ubuntu-playground:~/Ansible/possible-facts-bug$ ansible --version
[WARNING]: You are running the development version of Ansible. You should only run Ansible from "devel" if you are modifying the
Ansible engine, or trying out features under development. This is a rapidly changing source of code and can become unstable at
any point.
ansible [core 2.14.0.dev0]
  config file = None
  configured module search path = ['/home/christopher/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/christopher/Ansible/possible-facts-bug/venv/lib/python3.8/site-packages/ansible
  ansible collection location = /home/christopher/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/christopher/Ansible/possible-facts-bug/venv/bin/ansible
  python version = 3.8.10 (default, Mar 15 2022, 12:22:08) [GCC 9.4.0] (/home/christopher/Ansible/possible-facts-bug/venv/bin/python)
  jinja version = 3.1.2
  libyaml = True
```


### Configuration

```console
(venv) christopher@ubuntu-playground:~/Ansible/possible-facts-bug$ ansible-config dump --only-changed -t all
[WARNING]: You are running the development version of Ansible. You should only run Ansible from "devel" if you are modifying the
Ansible engine, or trying out features under development. This is a rapidly changing source of code and can become unstable at
any point.
CONFIG_FILE() = None

BECOME:
======

runas:
_____
become_user(REQUIRED) = None

CACHE:
=====

jsonfile:
________
_uri(REQUIRED) = None

CALLBACK:
========

CLICONF:
=======

CONNECTION:
==========

HTTPAPI:
=======

INVENTORY:
=========

constructed:
___________
plugin(REQUIRED) = None

generator:
_________
plugin(REQUIRED) = None

LOOKUP:
======

config:
______
_terms(REQUIRED) = None

dict:
____
_terms(REQUIRED) = None

env:
___
_terms(REQUIRED) = None

file:
____
_terms(REQUIRED) = None

fileglob:
________
_terms(REQUIRED) = None

indexed_items:
_____________
_terms(REQUIRED) = None

ini:
___
_terms(REQUIRED) = None

items:
_____
_terms(REQUIRED) = None

lines:
_____
_terms(REQUIRED) = None

nested:
______
_raw(REQUIRED) = None

password:
________
_terms(REQUIRED) = None

pipe:
____
_terms(REQUIRED) = None

subelements:
___________
_terms(REQUIRED) = None

together:
________
_terms(REQUIRED) = None

unvault:
_______
_terms(REQUIRED) = None

varnames:
________
_terms(REQUIRED) = None

vars:
____
_terms(REQUIRED) = None

NETCONF:
=======

SHELL:
=====

VARS:
====
```


### OS / Environment

Observed when an Ubuntu 20.04 host (which happens to be the Ansible control node as well) is targeted.

Sample inventory file:
```
(venv) christopher@ubuntu-playground:~/Ansible/possible-facts-bug$ tree -I venv
.
└── hosts

0 directories, 1 file
(venv) christopher@ubuntu-playground:~/Ansible/possible-facts-bug$ cat hosts
---
all:
  hosts:
    ubuntu-playground.chrisjhart.net:
      ansible_host: "192.168.10.51"
      ansible_user: "christopher"
      ansible_password: "H0meLab"
      ansible_become_password: "H0meLab"
```

### Steps to Reproduce

Sample inventory file:
```
(venv) christopher@ubuntu-playground:~/Ansible/possible-facts-bug$ tree -I venv
.
└── hosts

0 directories, 1 file
(venv) christopher@ubuntu-playground:~/Ansible/possible-facts-bug$ cat hosts
---
all:
  hosts:
    ubuntu-playground.chrisjhart.net:
      ansible_host: "192.168.10.51"
      ansible_user: "christopher"
      ansible_password: "H0meLab"
      ansible_become_password: "H0meLab"
```
Reproduce this issue with the `ansible -i hosts -m ansible.builtin.gather_facts ubuntu-playground.chrisjhart.net` command.

### Expected Results

Facts should be gathered from the Ansible control node successfully if targeted. This works in ansible-core 2.12.5.

```
(venv) christopher@ubuntu-playground:~/Ansible/possible-facts-bug$ pip install ansible-core==2.12.5
Collecting ansible-core==2.12.5
  Using cached ansible-core-2.12.5.tar.gz (7.8 MB)
Requirement already satisfied: PyYAML in ./venv/lib/python3.8/site-packages (from ansible-core==2.12.5) (6.0)
Requirement already satisfied: cryptography in ./venv/lib/python3.8/site-packages (from ansible-core==2.12.5) (37.0.2)
Requirement already satisfied: jinja2 in ./venv/lib/python3.8/site-packages (from ansible-core==2.12.5) (3.1.2)
Requirement already satisfied: packaging in ./venv/lib/python3.8/site-packages (from ansible-core==2.12.5) (21.3)
Requirement already satisfied: resolvelib<0.6.0,>=0.5.3 in ./venv/lib/python3.8/site-packages (from ansible-core==2.12.5) (0.5.4)
Requirement already satisfied: cffi>=1.12 in ./venv/lib/python3.8/site-packages (from cryptography->ansible-core==2.12.5) (1.15.0)
Requirement already satisfied: MarkupSafe>=2.0 in ./venv/lib/python3.8/site-packages (from jinja2->ansible-core==2.12.5) (2.1.1)
Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in ./venv/lib/python3.8/site-packages (from packaging->ansible-core==2.12.5) (3.0.9)
Requirement already satisfied: pycparser in ./venv/lib/python3.8/site-packages (from cffi>=1.12->cryptography->ansible-core==2.12.5) (2.21)
Building wheels for collected packages: ansible-core
  Building wheel for ansible-core (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /home/christopher/Ansible/possible-facts-bug/venv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-8a160x6y/ansible-core/setup.py'"'"'; __file__='"'"'/tmp/pip-install-8a160x6y/ansible-core/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-3735x_8c
       cwd: /tmp/pip-install-8a160x6y/ansible-core/
  Complete output (6 lines):
  usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
     or: setup.py --help [cmd1 cmd2 ...]
     or: setup.py --help-commands
     or: setup.py cmd --help
  
  error: invalid command 'bdist_wheel'
  ----------------------------------------
  ERROR: Failed building wheel for ansible-core
  Running setup.py clean for ansible-core
Failed to build ansible-core
Installing collected packages: ansible-core
  Attempting uninstall: ansible-core
    Found existing installation: ansible-core 2.14.0.dev0
    Uninstalling ansible-core-2.14.0.dev0:
      Successfully uninstalled ansible-core-2.14.0.dev0
    Running setup.py install for ansible-core ... done
Successfully installed ansible-core-2.12.5

(venv) christopher@ubuntu-playground:~/Ansible/possible-facts-bug$ ansible -i hosts -m ansible.builtin.gather_facts ubuntu-playground.chrisjhart.net | grep SUCCESS
ubuntu-playground.chrisjhart.net | SUCCESS => {

(venv) christopher@ubuntu-playground:~/Ansible/possible-facts-bug$ python -m pip install https://github.com/ansible/ansible/archive/devel.tar.gz
Collecting https://github.com/ansible/ansible/archive/devel.tar.gz
  Using cached https://github.com/ansible/ansible/archive/devel.tar.gz
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Requirement already satisfied: resolvelib<0.6.0,>=0.5.3 in ./venv/lib/python3.8/site-packages (from ansible-core==2.14.0.dev0) (0.5.4)
Requirement already satisfied: packaging in ./venv/lib/python3.8/site-packages (from ansible-core==2.14.0.dev0) (21.3)
Requirement already satisfied: cryptography in ./venv/lib/python3.8/site-packages (from ansible-core==2.14.0.dev0) (37.0.2)
Requirement already satisfied: PyYAML in ./venv/lib/python3.8/site-packages (from ansible-core==2.14.0.dev0) (6.0)
Requirement already satisfied: jinja2>=3.0.0 in ./venv/lib/python3.8/site-packages (from ansible-core==2.14.0.dev0) (3.1.2)
Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in ./venv/lib/python3.8/site-packages (from packaging->ansible-core==2.14.0.dev0) (3.0.9)
Requirement already satisfied: cffi>=1.12 in ./venv/lib/python3.8/site-packages (from cryptography->ansible-core==2.14.0.dev0) (1.15.0)
Requirement already satisfied: MarkupSafe>=2.0 in ./venv/lib/python3.8/site-packages (from jinja2>=3.0.0->ansible-core==2.14.0.dev0) (2.1.1)
Requirement already satisfied: pycparser in ./venv/lib/python3.8/site-packages (from cffi>=1.12->cryptography->ansible-core==2.14.0.dev0) (2.21)
Building wheels for collected packages: ansible-core
  Building wheel for ansible-core (PEP 517) ... done
  Created wheel for ansible-core: filename=ansible_core-2.14.0.dev0-py3-none-any.whl size=2097686 sha256=cb61c006e233500f064688a6d6bbfe272fdb5e0d0a4b8d9bc80dbdbe58617f07
  Stored in directory: /tmp/pip-ephem-wheel-cache-2r1h9any/wheels/8c/45/49/f37d83e18a917d0761921cc61a5e1056a364fbbdf41f633983
Successfully built ansible-core
Installing collected packages: ansible-core
  Attempting uninstall: ansible-core
    Found existing installation: ansible-core 2.12.5
    Uninstalling ansible-core-2.12.5:
      Successfully uninstalled ansible-core-2.12.5
Successfully installed ansible-core-2.14.0.dev0

(venv) christopher@ubuntu-playground:~/Ansible/possible-facts-bug$ ansible -i hosts -m ansible.builtin.gather_facts ubuntu-playground.chrisjhart.net | grep FAILURE
[WARNING]: You are running the development version of Ansible. You should only
run Ansible from "devel" if you are modifying the Ansible engine, or trying out
features under development. This is a rapidly changing source of code and can
become unstable at any point.
            "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
```

### Actual Results

```console
(venv) christopher@ubuntu-playground:~/Ansible/possible-facts-bug$ ansible -i hosts -m ansible.builtin.gather_facts ubuntu-playground.chrisjhart.net
[WARNING]: You are running the development version of Ansible. You should only run Ansible from "devel" if you are modifying the
Ansible engine, or trying out features under development. This is a rapidly changing source of code and can become unstable at
any point.
ubuntu-playground.chrisjhart.net | FAILED! => {
    "ansible_facts": {},
    "changed": false,
    "failed_modules": {
        "ansible.legacy.setup": {
            "ansible_facts": {
                "discovered_interpreter_python": "/usr/bin/python3"
            },
            "exception": "Traceback (most recent call last):\r\n  File \"/home/christopher/.ansible/tmp/ansible-tmp-1652983732.2403364-4039422-225017112537627/AnsiballZ_setup.py\", line 107, in <module>\r\n    _ansiballz_main()\r\n  File \"/home/christopher/.ansible/tmp/ansible-tmp-1652983732.2403364-4039422-225017112537627/AnsiballZ_setup.py\", line 99, in _ansiballz_main\r\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\r\n  File \"/home/christopher/.ansible/tmp/ansible-tmp-1652983732.2403364-4039422-225017112537627/AnsiballZ_setup.py\", line 47, in invoke_module\r\n    runpy.run_module(mod_name='ansible.modules.setup', init_globals=dict(_module_fqn='ansible.modules.setup', _modlib_path=modlib_path),\r\n  File \"/usr/lib/python3.8/runpy.py\", line 207, in run_module\r\n    return _run_module_code(code, init_globals, run_name, mod_spec)\r\n  File \"/usr/lib/python3.8/runpy.py\", line 97, in _run_module_code\r\n    _run_code(code, mod_globals, init_globals,\r\n  File \"/usr/lib/python3.8/runpy.py\", line 87, in _run_code\r\n    exec(code, run_globals)\r\n  File \"/tmp/ansible_ansible.legacy.setup_payload_4kdoi295/ansible_ansible.legacy.setup_payload.zip/ansible/modules/setup.py\", line 168, in <module>\r\n  File \"<frozen importlib._bootstrap>\", line 991, in _find_and_load\r\n  File \"<frozen importlib._bootstrap>\", line 975, in _find_and_load_unlocked\r\n  File \"<frozen importlib._bootstrap>\", line 655, in _load_unlocked\r\n  File \"<frozen importlib._bootstrap>\", line 618, in _load_backward_compatible\r\n  File \"<frozen zipimport>\", line 259, in load_module\r\n  File \"/tmp/ansible_ansible.legacy.setup_payload_4kdoi295/ansible_ansible.legacy.setup_payload.zip/ansible/module_utils/facts/__init__.py\", line 34, in <module>\r\n  File \"<frozen importlib._bootstrap>\", line 991, in _find_and_load\r\n  File \"<frozen importlib._bootstrap>\", line 975, in _find_and_load_unlocked\r\n  File \"<frozen importlib._bootstrap>\", line 655, in _load_unlocked\r\n  File \"<frozen importlib._bootstrap>\", line 618, in _load_backward_compatible\r\n  File \"<frozen zipimport>\", line 259, in load_module\r\n  File \"/tmp/ansible_ansible.legacy.setup_payload_4kdoi295/ansible_ansible.legacy.setup_payload.zip/ansible/module_utils/facts/compat.py\", line 33, in <module>\r\n  File \"<frozen importlib._bootstrap>\", line 991, in _find_and_load\r\n  File \"<frozen importlib._bootstrap>\", line 975, in _find_and_load_unlocked\r\n  File \"<frozen importlib._bootstrap>\", line 655, in _load_unlocked\r\n  File \"<frozen importlib._bootstrap>\", line 618, in _load_backward_compatible\r\n  File \"<frozen zipimport>\", line 259, in load_module\r\n  File \"/tmp/ansible_ansible.legacy.setup_payload_4kdoi295/ansible_ansible.legacy.setup_payload.zip/ansible/module_utils/facts/default_collectors.py\", line 31, in <module>\r\n  File \"<frozen importlib._bootstrap>\", line 991, in _find_and_load\r\n  File \"<frozen importlib._bootstrap>\", line 975, in _find_and_load_unlocked\r\n  File \"<frozen importlib._bootstrap>\", line 655, in _load_unlocked\r\n  File \"<frozen importlib._bootstrap>\", line 618, in _load_backward_compatible\r\n  File \"<frozen zipimport>\", line 259, in load_module\r\n  File \"/tmp/ansible_ansible.legacy.setup_payload_4kdoi295/ansible_ansible.legacy.setup_payload.zip/ansible/module_utils/compat/typing.py\", line 8, in <module>\r\n    * Two classes whose instances can be type arguments in addition to types: ForwardRef and TypeVar\r\nAttributeError: module 'typing_extensions' has no attribute 'OrderedDictTypedDict'\r\n",
            "failed": true,
            "module_stderr": "Shared connection to 192.168.10.51 closed.\r\n",
            "module_stdout": "Traceback (most recent call last):\r\n  File \"/home/christopher/.ansible/tmp/ansible-tmp-1652983732.2403364-4039422-225017112537627/AnsiballZ_setup.py\", line 107, in <module>\r\n    _ansiballz_main()\r\n  File \"/home/christopher/.ansible/tmp/ansible-tmp-1652983732.2403364-4039422-225017112537627/AnsiballZ_setup.py\", line 99, in _ansiballz_main\r\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\r\n  File \"/home/christopher/.ansible/tmp/ansible-tmp-1652983732.2403364-4039422-225017112537627/AnsiballZ_setup.py\", line 47, in invoke_module\r\n    runpy.run_module(mod_name='ansible.modules.setup', init_globals=dict(_module_fqn='ansible.modules.setup', _modlib_path=modlib_path),\r\n  File \"/usr/lib/python3.8/runpy.py\", line 207, in run_module\r\n    return _run_module_code(code, init_globals, run_name, mod_spec)\r\n  File \"/usr/lib/python3.8/runpy.py\", line 97, in _run_module_code\r\n    _run_code(code, mod_globals, init_globals,\r\n  File \"/usr/lib/python3.8/runpy.py\", line 87, in _run_code\r\n    exec(code, run_globals)\r\n  File \"/tmp/ansible_ansible.legacy.setup_payload_4kdoi295/ansible_ansible.legacy.setup_payload.zip/ansible/modules/setup.py\", line 168, in <module>\r\n  File \"<frozen importlib._bootstrap>\", line 991, in _find_and_load\r\n  File \"<frozen importlib._bootstrap>\", line 975, in _find_and_load_unlocked\r\n  File \"<frozen importlib._bootstrap>\", line 655, in _load_unlocked\r\n  File \"<frozen importlib._bootstrap>\", line 618, in _load_backward_compatible\r\n  File \"<frozen zipimport>\", line 259, in load_module\r\n  File \"/tmp/ansible_ansible.legacy.setup_payload_4kdoi295/ansible_ansible.legacy.setup_payload.zip/ansible/module_utils/facts/__init__.py\", line 34, in <module>\r\n  File \"<frozen importlib._bootstrap>\", line 991, in _find_and_load\r\n  File \"<frozen importlib._bootstrap>\", line 975, in _find_and_load_unlocked\r\n  File \"<frozen importlib._bootstrap>\", line 655, in _load_unlocked\r\n  File \"<frozen importlib._bootstrap>\", line 618, in _load_backward_compatible\r\n  File \"<frozen zipimport>\", line 259, in load_module\r\n  File \"/tmp/ansible_ansible.legacy.setup_payload_4kdoi295/ansible_ansible.legacy.setup_payload.zip/ansible/module_utils/facts/compat.py\", line 33, in <module>\r\n  File \"<frozen importlib._bootstrap>\", line 991, in _find_and_load\r\n  File \"<frozen importlib._bootstrap>\", line 975, in _find_and_load_unlocked\r\n  File \"<frozen importlib._bootstrap>\", line 655, in _load_unlocked\r\n  File \"<frozen importlib._bootstrap>\", line 618, in _load_backward_compatible\r\n  File \"<frozen zipimport>\", line 259, in load_module\r\n  File \"/tmp/ansible_ansible.legacy.setup_payload_4kdoi295/ansible_ansible.legacy.setup_payload.zip/ansible/module_utils/facts/default_collectors.py\", line 31, in <module>\r\n  File \"<frozen importlib._bootstrap>\", line 991, in _find_and_load\r\n  File \"<frozen importlib._bootstrap>\", line 975, in _find_and_load_unlocked\r\n  File \"<frozen importlib._bootstrap>\", line 655, in _load_unlocked\r\n  File \"<frozen importlib._bootstrap>\", line 618, in _load_backward_compatible\r\n  File \"<frozen zipimport>\", line 259, in load_module\r\n  File \"/tmp/ansible_ansible.legacy.setup_payload_4kdoi295/ansible_ansible.legacy.setup_payload.zip/ansible/module_utils/compat/typing.py\", line 8, in <module>\r\n    * Two classes whose instances can be type arguments in addition to types: ForwardRef and TypeVar\r\nAttributeError: module 'typing_extensions' has no attribute 'OrderedDictTypedDict'\r\n",
            "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
            "rc": 1
        }
    },
    "msg": "The following modules failed to execute: ansible.legacy.setup\n"
}
```

```pytb
Traceback (most recent call last):
  File "/home/christopher/.ansible/tmp/ansible-tmp-1652983732.2403364-4039422-225017112537627/AnsiballZ_setup.py", line 107, in <module>
    _ansiballz_main()
  File "/home/christopher/.ansible/tmp/ansible-tmp-1652983732.2403364-4039422-225017112537627/AnsiballZ_setup.py", line 99, in _ansiballz_main
    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
  File "/home/christopher/.ansible/tmp/ansible-tmp-1652983732.2403364-4039422-225017112537627/AnsiballZ_setup.py", line 47, in invoke_module
    runpy.run_module(mod_name='ansible.modules.setup', init_globals=dict(_module_fqn='ansible.modules.setup', _modlib_path=modlib_path),
  File "/usr/lib/python3.8/runpy.py", line 207, in run_module
    return _run_module_code(code, init_globals, run_name, mod_spec)
  File "/usr/lib/python3.8/runpy.py", line 97, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/tmp/ansible_ansible.legacy.setup_payload_4kdoi295/ansible_ansible.legacy.setup_payload.zip/ansible/modules/setup.py", line 168, in <module>
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 618, in _load_backward_compatible
  File "<frozen zipimport>", line 259, in load_module
  File "/tmp/ansible_ansible.legacy.setup_payload_4kdoi295/ansible_ansible.legacy.setup_payload.zip/ansible/module_utils/facts/__init__.py", line 34, in <module>
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 618, in _load_backward_compatible
  File "<frozen zipimport>", line 259, in load_module
  File "/tmp/ansible_ansible.legacy.setup_payload_4kdoi295/ansible_ansible.legacy.setup_payload.zip/ansible/module_utils/facts/compat.py", line 33, in <module>
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 618, in _load_backward_compatible
  File "<frozen zipimport>", line 259, in load_module
  File "/tmp/ansible_ansible.legacy.setup_payload_4kdoi295/ansible_ansible.legacy.setup_payload.zip/ansible/module_utils/facts/default_collectors.py", line 31, in <module>
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 618, in _load_backward_compatible
  File "<frozen zipimport>", line 259, in load_module
  File "/tmp/ansible_ansible.legacy.setup_payload_4kdoi295/ansible_ansible.legacy.setup_payload.zip/ansible/module_utils/compat/typing.py", line 8, in <module>
    * Two classes whose instances can be type arguments in addition to types: ForwardRef and TypeVar
AttributeError: module 'typing_extensions' has no attribute 'OrderedDictTypedDict'
```

### Code of Conduct

- [X] I agree to follow the Ansible Code of Conduct
"""Compatibility layer for the `typing` module, providing all Python versions access to the newest type-hinting features."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
try:
    from typing_extensions import *
except ImportError:
    pass
try:
    from typing import *  
except ImportError:
    pass