EW 2520 then EW 7521 at Barcelona
Stuttgart → Barcelona → Hamburg
Timetable, Barcelona time
14:25EW 2520 from Stuttgart at the gate
09:20EW 7521 to Hamburg leaves the gate
18 h 55 apart on the timetable, overnight
EW 7521 leaves 18 h 55 after EW 2520 arrives on the timetable: more than half a day, so not a connection we count.