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