FR 5357 then FR 188 at Madrid
Krakow → Madrid → Edinburgh
Timetable, Madrid time
19:25FR 5357 from Krakow at the gate
19:10FR 188 to Edinburgh leaves the gate
23 h 45 apart on the timetable, overnight
FR 188 leaves 23 h 45 after FR 5357 arrives on the timetable: more than half a day, so not a connection we count.