FR 2761 then FR 2766 at Madrid
Bari → Madrid → Prague
Timetable, Madrid time
15:15FR 2761 from Bari at the gate
09:50FR 2766 to Prague leaves the gate
18 h 35 apart on the timetable, overnight
FR 2766 leaves 18 h 35 after FR 2761 arrives on the timetable: more than half a day, so not a connection we count.