PU 302 then IB 1401 at Madrid
Lima → Madrid → Valencia
Timetable, Madrid time
12:45PU 302 from Lima at the gate
11:30IB 1401 to Valencia leaves the gate
22 h 45 apart on the timetable, overnight
IB 1401 leaves 22 h 45 after PU 302 arrives on the timetable: more than half a day, so not a connection we count.