W9 5724 then U2 804 at Gatwick
Málaga → London → Edinburgh
Timetable, London time
12:55W9 5724 from Málaga at the gate
10:45U2 804 to Edinburgh leaves the gate
21 h 50 apart on the timetable, overnight
U2 804 leaves 21 h 50 after W9 5724 arrives on the timetable: more than half a day, so not a connection we count.