FR 5930 then FR 5356 at Madrid
Fes → Madrid → Krakow
Timetable, Madrid time
18:20FR 5930 from Fes at the gate
14:45FR 5356 to Krakow leaves the gate
20 h 25 apart on the timetable, overnight
FR 5356 leaves 20 h 25 after FR 5930 arrives on the timetable: more than half a day, so not a connection we count.