FR 4596 then FR 3185 at Barcelona
Porto → Barcelona → Rabat
Timetable, Barcelona time
14:30FR 4596 from Porto at the gate
12:05FR 3185 to Rabat leaves the gate
21 h 35 apart on the timetable, overnight
FR 3185 leaves 21 h 35 after FR 4596 arrives on the timetable: more than half a day, so not a connection we count.