FR 4641 then FR 4616 at Arlanda
Riga → Stockholm → Gdansk
Timetable, Stockholm time
14:00FR 4641 from Riga at the gate
12:40FR 4616 to Gdansk leaves the gate
22 h 40 apart on the timetable, overnight
FR 4616 leaves 22 h 40 after FR 4641 arrives on the timetable: more than half a day, so not a connection we count.