BA 1487 then IB 726 at Heathrow
Glasgow → London → Madrid
Timetable, London time
20:05BA 1487 from Glasgow at the gate
19:40IB 726 to Madrid leaves the gate
23 h 35 apart on the timetable, overnight
IB 726 leaves 23 h 35 after BA 1487 arrives on the timetable: more than half a day, so not a connection we count.