FR 573 then FR 2766 at Madrid
Porto → Madrid → Prague
Timetable, Madrid time
22:05FR 573 from Porto at the gate
20:50FR 2766 to Prague leaves the gate
22 h 45 apart on the timetable, overnight
FR 2766 leaves 22 h 45 after FR 573 arrives on the timetable: more than half a day, so not a connection we count.