U2 803 then U2 8281 at Gatwick
Edinburgh → London → Bari
Timetable, London time
15:15U2 803 from Edinburgh at the gate
14:00U2 8281 to Bari leaves the gate
22 h 45 apart on the timetable, overnight
U2 8281 leaves 22 h 45 after U2 803 arrives on the timetable: more than half a day, so not a connection we count.