FR 2761 then FR 2513 at Madrid
Bari → Madrid → Bucharest
Timetable, Madrid time
15:15FR 2761 from Bari at the gate
06:55FR 2513 to Bucharest leaves the gate
15 h 40 apart on the timetable, overnight
FR 2513 leaves 15 h 40 after FR 2761 arrives on the timetable: more than half a day, so not a connection we count.