3O 391 then FR 5713 at Madrid
Tangier → Madrid → Budapest
Timetable, Madrid time
12:503O 391 from Tangier at the gate
09:40FR 5713 to Budapest leaves the gate
20 h 50 apart on the timetable, overnight
FR 5713 leaves 20 h 50 after 3O 391 arrives on the timetable: more than half a day, so not a connection we count.