FR 775 then FR 8394 at Barcelona
Torino → Barcelona → Budapest
Timetable, Barcelona time
20:00FR 775 from Torino at the gate
18:35FR 8394 to Budapest leaves the gate
22 h 35 apart on the timetable, overnight
FR 8394 leaves 22 h 35 after FR 775 arrives on the timetable: more than half a day, so not a connection we count.