FR 3877 then EC 7652 at Madrid
Tangier → Madrid → Lisbon
Timetable, Madrid time
22:35FR 3877 from Tangier at the gate
22:10EC 7652 to Lisbon leaves the gate
23 h 35 apart on the timetable, overnight
EC 7652 leaves 23 h 35 after FR 3877 arrives on the timetable: more than half a day, so not a connection we count.