KM 586 then UX 1047 at Madrid
Valletta → Madrid → Rome
Timetable, Madrid time
20:40KM 586 from Valletta at the gate
15:00UX 1047 to Rome leaves the gate
18 h 20 apart on the timetable, overnight
UX 1047 leaves 18 h 20 after KM 586 arrives on the timetable: more than half a day, so not a connection we count.