FR 5357 then FR 725 at Madrid
Krakow → Madrid → Palermo
Timetable, Madrid time
22:20FR 5357 from Krakow at the gate
21:25FR 725 to Palermo leaves the gate
23 h 05 apart on the timetable, overnight
FR 725 leaves 23 h 05 after FR 5357 arrives on the timetable: more than half a day, so not a connection we count.