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