The problem is related to the way in which the PBX considers the IVR entity: in fact in the most recent versions of the PBX the responder is an EXTERNAL entity and in order for it to make calls to external numbers, there must be a specific routing rule that indicates that for call that external number, the calling type must be EXTERNAL. It is therefore necessary to create a routing rule as follows:
Caller type: External or All
Caller number:%
Number called: ^ EXTERNAL NUMBER $ (where EXTERNAL NUMBER is the number to which the IVR node must transfer the call)
Route to: desired gateway
Here is an example of the configuration of the routing rule