FR 6712 then W4 6312 at Madrid
Budapest → Madrid → Milan
Timetable, Madrid time
11:55FR 6712 from Budapest at the gate
09:55W4 6312 to Milan leaves the gate
22 h apart on the timetable, overnight
W4 6312 leaves 22 h after FR 6712 arrives on the timetable: more than half a day, so not a connection we count.