FR 573 then AT 5304 at Madrid
Porto → Madrid → Marrakesh
Timetable, Madrid time
22:05FR 573 from Porto at the gate
19:30AT 5304 to Marrakesh leaves the gatealso VY 5477, BA 7165
21 h 25 apart on the timetable, overnight
AT 5304 leaves 21 h 25 after FR 573 arrives on the timetable: more than half a day, so not a connection we count.