FR 6723 then FR 5931 at Madrid
Marrakesh → Madrid → Fes
Timetable, Madrid time
22:45FR 6723 from Marrakesh at the gate
16:15FR 5931 to Fes leaves the gate
17 h 30 apart on the timetable, overnight
FR 5931 leaves 17 h 30 after FR 6723 arrives on the timetable: more than half a day, so not a connection we count.