FR 189 then W6 1702 at Madrid
Edinburgh → Madrid → Gdansk
Timetable, Madrid time
13:55FR 189 from Edinburgh at the gate
10:40W6 1702 to Gdansk leaves the gate
20 h 45 apart on the timetable, overnight
W6 1702 leaves 20 h 45 after FR 189 arrives on the timetable: more than half a day, so not a connection we count.