FR 6723 then FR 2066 at Madrid
Marrakesh → Madrid → Ibiza
Timetable, Madrid time
22:15FR 6723 from Marrakesh at the gate
20:35FR 2066 to Ibiza leaves the gate
22 h 20 apart on the timetable, overnight
FR 2066 leaves 22 h 20 after FR 6723 arrives on the timetable: more than half a day, so not a connection we count.