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