FR 2540 then FR 3831 at Madrid
Bucharest → Madrid → Bologna
Timetable, Madrid time
08:45FR 2540 from Bucharest at the gate
21:00FR 3831 to Bologna leaves the gate
12 h 15 apart on the timetable
FR 3831 leaves 12 h 15 after FR 2540 arrives on the timetable: more than half a day, so not a connection we count.