3O 377 then QR 3515 at Barcelona
Tangier → Barcelona → Madrid
Timetable, Barcelona time
16:453O 377 from Tangier at the gate
16:30QR 3515 to Madrid leaves the gate
23 h 45 apart on the timetable, overnight
QR 3515 leaves 23 h 45 after 3O 377 arrives on the timetable: more than half a day, so not a connection we count.