FR 334 then FR 4545 at Barcelona
Gdansk → Barcelona → Porto
Timetable, Barcelona time
10:35FR 334 from Gdansk at the gate
06:45FR 4545 to Porto leaves the gate
20 h 10 apart on the timetable, overnight
FR 4545 leaves 20 h 10 after FR 334 arrives on the timetable: more than half a day, so not a connection we count.