HV 5951 then IB 1142 at Lisbon
Amsterdam → Lisbon → Madrid
Timetable, Lisbon time
18:50HV 5951 from Amsterdam at the gate
12:30IB 1142 to Madrid leaves the gate
17 h 40 apart on the timetable, overnight
IB 1142 leaves 17 h 40 after HV 5951 arrives on the timetable: more than half a day, so not a connection we count.