This may seem obvious to some, but just announcing this.
After the party interrupted Magus's summoning spell, the timeline where he did summon Lavos was abolished, but existed in some form in the Darkness Beyond Time. Perhaps in the Darkness Beyond Time, that old part of the timeline was "summed up" in the Magus from the Lavos timeline.
It is interesting to note that the rippling water effect that appears when you enter the bucket gate also appears here. In Chrono Cross, the same water effect happens when you fight the Time Devourer. Maybe the Dream Devourer escaped its prison through the gate you use to enter its prison and fight it. Of course, the resurrected fragment of Lavos just enters another prison.