FR 2776 then FR 7071 at Madrid
Palma de Mallorca → Madrid → Gdansk
Timetable, Madrid time
15:55FR 2776 from Palma de Mallorca at the gate
10:15FR 7071 to Gdansk leaves the gate
18 h 20 apart on the timetable, overnight
FR 7071 leaves 18 h 20 after FR 2776 arrives on the timetable: more than half a day, so not a connection we count.