Ansible adhoc command stuck on host pingable but not reachable on port 22

Those timeouts apply to some specific parts of the connection, not the total execution (see task timeout for that), so you can get to a point where those timeouts are not relevant anymore and still get stuck.