FR 7851 then FR 5563 at Dublin
Cardiff → Dublin → Glasgow
Timetable, Dublin time
00:50FR 7851 from Cardiff at the gate
18:00FR 5563 to Glasgow leaves the gate
17 h 10 apart on the timetable
FR 5563 leaves 17 h 10 after FR 7851 arrives on the timetable: more than half a day, so not a connection we count.