IB 5389 then IB 412 at Barcelona
Bari → Barcelona → Madrid
Timetable, Barcelona time
18:35IB 5389 from Bari at the gatealso LL 5389, VY 6113
13:35IB 412 to Madrid leaves the gatealso LA 1524, LA 1577, CX 1926, LL 3012, VY 5060, AV 6172, BA 7081, QR 8004, AA 8776
19 h apart on the timetable, overnight
IB 412 leaves 19 h after IB 5389 arrives on the timetable: more than half a day, so not a connection we count.