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