Sounds like you’re using a stale EPEL mirror. The current Rocky 8 AppStream is distributing python3.12dist(ansible-core) == 2.16.3, and the current EPEL mirror is distributing ansible-9.2.0-1.el8.noarch and requires python3.12dist(ansible-core) >= 2.16.3. The older versions do not appear to be available anymore.