UA 120 then VY 1006 at Barcelona
Newark → Barcelona → Madrid
Timetable, Barcelona time
08:20UA 120 from Newark at the gatealso LX 3011, LH 7968
07:30VY 1006 to Madrid leaves the gatealso QR 5524, IB 5990, LL 5990
23 h 10 apart on the timetable, overnight
VY 1006 leaves 23 h 10 after UA 120 arrives on the timetable: more than half a day, so not a connection we count.