FR 2761 then FR 725 at Madrid
Bari → Madrid → Palermo
Timetable, Madrid time
18:45FR 2761 from Bari at the gate
12:55FR 725 to Palermo leaves the gate
18 h 10 apart on the timetable, overnight
FR 725 leaves 18 h 10 after FR 2761 arrives on the timetable: more than half a day, so not a connection we count.