FR 499 then FR 5686 at Madrid
London Stansted → Madrid → Edinburgh
Timetable, Madrid time
19:20FR 499 from London Stansted at the gate
17:25FR 5686 to Edinburgh leaves the gate
22 h 05 apart on the timetable, overnight
FR 5686 leaves 22 h 05 after FR 499 arrives on the timetable: more than half a day, so not a connection we count.