FR 5150 then I2 1886 at Dublin
Glasgow → Dublin → Madrid
Timetable, Dublin time
23:40FR 5150 from Glasgow at the gate
18:30I2 1886 to Madrid leaves the gate
18 h 50 apart on the timetable, overnight
I2 1886 leaves 18 h 50 after FR 5150 arrives on the timetable: more than half a day, so not a connection we count.