Foreman fails to login via SSH to VMs when doing image based deployment

Problem:
I’m trying to deploy a VM via an image based deployment in VMware. The machine gets clone and deployed without any problems, but when Foreman tries to connect to the VM to provision the Finish Template there is no response from the machine and eventually there is a timeout error as shown below.

The only thing I see missing (compared to a preproduction env where image based deployment works) is Dynflow installed in the router. I don’t know if this is related to the issue.

Expected outcome:
VM correctly deployed and configured.

Foreman and Proxy versions:
Foreman server: 3.5.1
Foreman Proxy: 3.5.1

Distribution and version:
Ubuntu 20.04

Other relevant data:

2023-03-06T13:19:59 [W|app|de197c80] Failed to login via SSH to <host>: execution expired
2023-03-06T13:19:59 [I|app|de197c80] Backtrace for 'Failed to login via SSH to <host>: execution expired' error (Timeout::Error): execution expired

Correction: Dynflow installed in the Proxy, not the router.