EC 4389 then FR 8239 at Madrid
Lyon → Madrid → Porto
Timetable, Madrid time
17:20EC 4389 from Lyon at the gate
17:05FR 8239 to Porto leaves the gate
23 h 45 apart on the timetable, overnight
FR 8239 leaves 23 h 45 after EC 4389 arrives on the timetable: more than half a day, so not a connection we count.