FR 5357 then IB 1857 at Madrid
Krakow → Madrid → Marrakesh
Timetable, Madrid time
22:20FR 5357 from Krakow at the gate
19:30IB 1857 to Marrakesh leaves the gatealso VY 5477, BA 7165
21 h 10 apart on the timetable, overnight
IB 1857 leaves 21 h 10 after FR 5357 arrives on the timetable: more than half a day, so not a connection we count.