UX 1042 then LO 2162 at Madrid
Rome → Madrid → Krakow
Timetable, Madrid time
20:35UX 1042 from Rome at the gate
20:00LO 2162 to Krakow leaves the gate
23 h 25 apart on the timetable, overnight
LO 2162 leaves 23 h 25 after UX 1042 arrives on the timetable: more than half a day, so not a connection we count.