FR 8249 then FR 394 at Madrid
Milan → Madrid → Ibiza
Timetable, Madrid time
10:50FR 8249 from Milan at the gate
06:30FR 394 to Ibiza leaves the gate
19 h 40 apart on the timetable, overnight
FR 394 leaves 19 h 40 after FR 8249 arrives on the timetable: more than half a day, so not a connection we count.