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