FR 2437 then FR 5484 at Madrid
Rome → Madrid → Porto
Timetable, Madrid time
22:45FR 2437 from Rome at the gate
21:40FR 5484 to Porto leaves the gate
22 h 55 apart on the timetable, overnight
FR 5484 leaves 22 h 55 after FR 2437 arrives on the timetable: more than half a day, so not a connection we count.