My theory is it's the fallout from Omnitraxus Prime's Death. Without him to regulate space-time the dimensions merged together.

Alternatively Marco and Star just belong together so much that magic merged together the different dimensions just to ensure they got sent back "to where they belong".