A traveler wandering the world freely like the wind. An expert in multiple jobs, he can also mimic the traits of his allies.
—Dissidia 012 description
A cheerful man with a strong sense of justice and the inability to ignore those in trouble.—Dissidia Final Fantasy description
Bartz Klauser wanders the earth at his father Dorgann’s, a Dawn Warrior from years past, dying request. He first arrives in World B through the Interdimensional Rift, a bizarre combination of dimensions between worlds. There, he meets Gilgamesh…
Gilgamesh: “Well, well, Bartz. We meet again.”
Bartz: “Who’re you?”
…but doesn’t remember him. Who can forget Gilgamesh? Bartz encounters Gilgamesh six times. Two of those times are in the Interdimensional Rift, from which Bartz emerges. Did Cosmos call Bartz sometimes before he travels to the Interdimensional Rift?
Bartz does fight Exdeath before his world merges with Galuf’s. The party mysterious transports from Galuf’s world to Bartz. From this transportation, perhaps he arrives at World B through an Interdimensional Rift. Does Cosmos call Bartz to World B. I don’t think so? True to his wanderer nature, he simply stumbles upon it searching for a way through the Interdimensional Rift.
When does he stumble upon World B? The most likely answer is while he travels to the Interdimensional Rift. He’s aware of Exdeath, at least:
Exdeath: “Mwa-hahahaha! It seems the worm has finally slunk in.”Bartz: “Exdeath! Sorry, but I haven’t got time to deal with you now. Me and Zidane… we’ve got a race on!”
And Exdeath states to Bartz…
Exdeath: “You shall wander within the Rift forever!”
…implying exactly at what point Bartz finds himself in World B.

But then why doesn’t he remember Gilgamesh? Unless he completely forgot all of his memories or is simply forgetful, he would have some clue of Gilgamesh. But in actuality, it’s more likely for comedic effect.