FR 5358 then FR 2436 at Madrid
Krakow → Madrid → Rome
Timetable, Madrid time
15:15FR 5358 from Krakow at the gate
14:25FR 2436 to Rome leaves the gate
23 h 10 apart on the timetable, overnight
FR 2436 leaves 23 h 10 after FR 5358 arrives on the timetable: more than half a day, so not a connection we count.