BA 965 then BA 468 at Heathrow
Hamburg → London → Madrid
Timetable, London time
16:35BA 965 from Hamburg at the gate
16:25BA 468 to Madrid leaves the gate
23 h 50 apart on the timetable, overnight
BA 468 leaves 23 h 50 after BA 965 arrives on the timetable: more than half a day, so not a connection we count.