FR 7070 then FR 5713 at Madrid
Gdansk → Madrid → Budapest
Timetable, Madrid time
21:00FR 7070 from Gdansk at the gate
18:15FR 5713 to Budapest leaves the gate
21 h 15 apart on the timetable, overnight
FR 5713 leaves 21 h 15 after FR 7070 arrives on the timetable: more than half a day, so not a connection we count.