The issue was resolved by updating the versions of the libraries to:
ansible==4.10.0
ansible-core==2.11.12
ansible-runner==2.4.0
These versions are not the latest because I need to maintain compatibility with CentOS 7 systems running Python 2.7.
With this configuration, the issue no longer occurs.