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