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