FR 9875 then FR 3876 at Madrid
Rabat → Madrid → Tangier
Timetable, Madrid time
17:20FR 9875 from Rabat at the gate
06:10FR 3876 to Tangier leaves the gate
12 h 50 apart on the timetable, overnight
FR 3876 leaves 12 h 50 after FR 9875 arrives on the timetable: more than half a day, so not a connection we count.