BA 871 then IB 712 at Heathrow
Budapest → London → Madrid
Timetable, London time
09:50BA 871 from Budapest at the gate
09:15IB 712 to Madrid leaves the gate
23 h 25 apart on the timetable, overnight
IB 712 leaves 23 h 25 after BA 871 arrives on the timetable: more than half a day, so not a connection we count.