FR 2540 then AM 9999 at Madrid
Bucharest → Madrid → Mexico City
Timetable, Madrid time
13:55FR 2540 from Bucharest at the gate
11:45AM 9999 to Mexico City leaves the gate
21 h 50 apart on the timetable, overnight
AM 9999 leaves 21 h 50 after FR 2540 arrives on the timetable: more than half a day, so not a connection we count.