3O 391 then AA 8651 at Madrid
Tangier → Madrid → Barcelona
Timetable, Madrid time
20:003O 391 from Tangier at the gate
18:00AA 8651 to Barcelona leaves the gate
22 h apart on the timetable, overnight
AA 8651 leaves 22 h after 3O 391 arrives on the timetable: more than half a day, so not a connection we count.