FR 6712 then FR 5931 at Madrid
Budapest → Madrid → Fes
Timetable, Madrid time
18:10FR 6712 from Budapest at the gate
14:45FR 5931 to Fes leaves the gate
20 h 35 apart on the timetable, overnight
FR 5931 leaves 20 h 35 after FR 6712 arrives on the timetable: more than half a day, so not a connection we count.