FR 8240 then FR 2061 at Madrid
Porto → Madrid → Palma de Mallorca
Timetable, Madrid time
16:30FR 8240 from Porto at the gate
06:00FR 2061 to Palma de Mallorca leaves the gate
13 h 30 apart on the timetable, overnight
FR 2061 leaves 13 h 30 after FR 8240 arrives on the timetable: more than half a day, so not a connection we count.