AA 8762 then IB 1857 at Madrid
Valencia → Madrid → Marrakesh
Timetable, Madrid time
07:10AA 8762 from Valencia at the gate
19:30IB 1857 to Marrakesh leaves the gatealso VY 5477, BA 7165
12 h 20 apart on the timetable
IB 1857 leaves 12 h 20 after AA 8762 arrives on the timetable: more than half a day, so not a connection we count.