3O 391 then IB 785 at Madrid
Tangier → Madrid → Berlin
Timetable, Madrid time
16:403O 391 from Tangier at the gate
15:55IB 785 to Berlin leaves the gatealso VY 5166, AA 8738
23 h 15 apart on the timetable, overnight
IB 785 leaves 23 h 15 after 3O 391 arrives on the timetable: more than half a day, so not a connection we count.