FR 4584 then FR 333 at Barcelona
Porto → Barcelona → Gdansk
Timetable, Barcelona time
11:05FR 4584 from Porto at the gate
10:00FR 333 to Gdansk leaves the gate
22 h 55 apart on the timetable, overnight
FR 333 leaves 22 h 55 after FR 4584 arrives on the timetable: more than half a day, so not a connection we count.