FR 2527 then E9 857 at Madrid
Berlin → Madrid → San José (Costa Rica)
Timetable, Madrid time
23:10FR 2527 from Berlin at the gate
14:45E9 857 to San José (Costa Rica) leaves the gate
15 h 35 apart on the timetable, overnight
E9 857 leaves 15 h 35 after FR 2527 arrives on the timetable: more than half a day, so not a connection we count.