UX 138 then FR 3814 at Madrid
Quito → Madrid → Bologna
Timetable, Madrid time
05:00UX 138 from Quito at the gate
22:10FR 3814 to Bologna leaves the gate
17 h 10 apart on the timetable
FR 3814 leaves 17 h 10 after UX 138 arrives on the timetable: more than half a day, so not a connection we count.