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