W6 2391 then FR 5382 at Madrid
Budapest → Madrid → Valletta
Timetable, Madrid time
08:45W6 2391 from Budapest at the gate
21:35FR 5382 to Valletta leaves the gate
12 h 50 apart on the timetable
FR 5382 leaves 12 h 50 after W6 2391 arrives on the timetable: more than half a day, so not a connection we count.