FR 5322 then IB 421 at Madrid
Milan → Madrid → Barcelona
Timetable, Madrid time
19:45FR 5322 from Milan at the gate
18:00IB 421 to Barcelona leaves the gatealso IB 421S, LL 3021, VY 5122, AV 6170, QR 6971
22 h 15 apart on the timetable, overnight
IB 421 leaves 22 h 15 after FR 5322 arrives on the timetable: more than half a day, so not a connection we count.