FR 9673 then FR 5713 at Madrid
Rome → Madrid → Budapest
Timetable, Madrid time
23:30FR 9673 from Rome at the gate
20:10FR 5713 to Budapest leaves the gate
20 h 40 apart on the timetable, overnight
FR 5713 leaves 20 h 40 after FR 9673 arrives on the timetable: more than half a day, so not a connection we count.