AD 6902 then FR 5897 at Madrid
Málaga → Madrid → Torino
Timetable, Madrid time
07:30AD 6902 from Málaga at the gate
07:20FR 5897 to Torino leaves the gate
23 h 50 apart on the timetable, overnight
FR 5897 leaves 23 h 50 after AD 6902 arrives on the timetable: more than half a day, so not a connection we count.