FR 9601 then FR 5356 at Madrid
Rome → Madrid → Krakow
Timetable, Madrid time
21:20FR 9601 from Rome at the gate
20:00FR 5356 to Krakow leaves the gate
22 h 40 apart on the timetable, overnight
FR 5356 leaves 22 h 40 after FR 9601 arrives on the timetable: more than half a day, so not a connection we count.