FR 6723 then BT 686 at Madrid
Marrakesh → Madrid → Riga
Timetable, Madrid time
22:45FR 6723 from Marrakesh at the gate
17:15BT 686 to Riga leaves the gate
18 h 30 apart on the timetable, overnight
BT 686 leaves 18 h 30 after FR 6723 arrives on the timetable: more than half a day, so not a connection we count.