FR 9840 then W6 2394 at Lisbon
Cologne → Lisbon → Budapest
Timetable, Lisbon time
23:30FR 9840 from Cologne at the gate
19:40W6 2394 to Budapest leaves the gate
20 h 10 apart on the timetable, overnight
W6 2394 leaves 20 h 10 after FR 9840 arrives on the timetable: more than half a day, so not a connection we count.