W4 7992 then FR 2066 at Madrid
Pisa → Madrid → Ibiza
Timetable, Madrid time
19:05W4 7992 from Pisa at the gate
13:45FR 2066 to Ibiza leaves the gate
18 h 40 apart on the timetable, overnight
FR 2066 leaves 18 h 40 after W4 7992 arrives on the timetable: more than half a day, so not a connection we count.