FR 5898 then AT 5387 at Madrid
Torino → Madrid → Palma de Mallorca
Timetable, Madrid time
23:10FR 5898 from Torino at the gate
20:30AT 5387 to Palma de Mallorca leaves the gate
21 h 20 apart on the timetable, overnight
AT 5387 leaves 21 h 20 after FR 5898 arrives on the timetable: more than half a day, so not a connection we count.