AA 8574 then FR 5993 at Madrid
Porto → Madrid → London Stansted
Timetable, Madrid time
14:45AA 8574 from Porto at the gate
13:20FR 5993 to London Stansted leaves the gate
22 h 35 apart on the timetable, overnight
FR 5993 leaves 22 h 35 after AA 8574 arrives on the timetable: more than half a day, so not a connection we count.