FR 6712 then FR 9472 at Madrid
Budapest → Madrid → Pisa
Timetable, Madrid time
12:55FR 6712 from Budapest at the gate
12:25FR 9472 to Pisa leaves the gate
23 h 30 apart on the timetable, overnight
FR 9472 leaves 23 h 30 after FR 6712 arrives on the timetable: more than half a day, so not a connection we count.