FR 6409 then FR 2528 at Madrid
Sofia → Madrid → Berlin
Timetable, Madrid time
13:35FR 6409 from Sofia at the gate
06:15FR 2528 to Berlin leaves the gate
16 h 40 apart on the timetable, overnight
FR 2528 leaves 16 h 40 after FR 6409 arrives on the timetable: more than half a day, so not a connection we count.