FR 9471 then FR 7071 at Madrid
Pisa → Madrid → Gdansk
Timetable, Madrid time
11:50FR 9471 from Pisa at the gate
10:15FR 7071 to Gdansk leaves the gate
22 h 25 apart on the timetable, overnight
FR 7071 leaves 22 h 25 after FR 9471 arrives on the timetable: more than half a day, so not a connection we count.