FR 3877 then U2 3210 at Madrid
Tangier → Madrid → Edinburgh
Timetable, Madrid time
22:35FR 3877 from Tangier at the gate
16:30U2 3210 to Edinburgh leaves the gate
17 h 55 apart on the timetable, overnight
U2 3210 leaves 17 h 55 after FR 3877 arrives on the timetable: more than half a day, so not a connection we count.