FR 574 then FR 333 at Barcelona
Bologna → Barcelona → Gdansk
Timetable, Barcelona time
16:30FR 574 from Bologna at the gate
10:00FR 333 to Gdansk leaves the gate
17 h 30 apart on the timetable, overnight
FR 333 leaves 17 h 30 after FR 574 arrives on the timetable: more than half a day, so not a connection we count.