IB 2319 then BT 686 at Madrid
Castellón → Madrid → Riga
Timetable, Madrid time
19:20IB 2319 from Castellón at the gate
17:15BT 686 to Riga leaves the gate
21 h 55 apart on the timetable, overnight
BT 686 leaves 21 h 55 after IB 2319 arrives on the timetable: more than half a day, so not a connection we count.