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