FR 2527 then FR 394 at Madrid
Berlin → Madrid → Ibiza
Timetable, Madrid time
23:10FR 2527 from Berlin at the gate
18:10FR 394 to Ibiza leaves the gate
19 h apart on the timetable, overnight
FR 394 leaves 19 h after FR 2527 arrives on the timetable: more than half a day, so not a connection we count.