FR 5316 then IB 1857 at Madrid
Rome → Madrid → Marrakesh
Timetable, Madrid time
23:40FR 5316 from Rome at the gate
19:30IB 1857 to Marrakesh leaves the gatealso VY 5477, BA 7165
19 h 50 apart on the timetable, overnight
IB 1857 leaves 19 h 50 after FR 5316 arrives on the timetable: more than half a day, so not a connection we count.