FR 4023 then TP 1016 at Lisbon
Krakow → Lisbon → Madrid
Timetable, Lisbon time
17:45FR 4023 from Krakow at the gate
14:45TP 1016 to Madrid leaves the gate
21 h apart on the timetable, overnight
TP 1016 leaves 21 h after FR 4023 arrives on the timetable: more than half a day, so not a connection we count.