FR 2437 then FR 3876 at Madrid
Rome → Madrid → Tangier
Timetable, Madrid time
22:45FR 2437 from Rome at the gate
16:45FR 3876 to Tangier leaves the gate
18 h apart on the timetable, overnight
FR 3876 leaves 18 h after FR 2437 arrives on the timetable: more than half a day, so not a connection we count.