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