FR 5316 then IB 547 at Madrid
Rome → Madrid → Porto
Timetable, Madrid time
16:05FR 5316 from Rome at the gate
15:40IB 547 to Porto leaves the gate
23 h 35 apart on the timetable, overnight
IB 547 leaves 23 h 35 after FR 5316 arrives on the timetable: more than half a day, so not a connection we count.