The janamsakhis record Guru Nanak Dev Ji travelling west to Mecca and Medina and to Baghdad, in what the tradition counts as the fourth udasi.
The best known episode is at Mecca: he is found asleep with his feet toward the Kaaba, is reproached for it, and asks the man to turn his feet in a direction where God is not.
It is the most told sakhi after the disappearance in the Bein, and its point is the same as the point of the four doors of the Harmandir.
An inscription at Baghdad, on a structure associated with a figure called Baba Nanak, was reported in the nineteenth century and has been read as recording the visit. Its dating and reading are disputed and it has been argued over for a century.
Whether the journey happened is not established. The evidence is the janamsakhi tradition, which is devotional narrative, and one contested inscription.
The story is a statement about where God is, and it works whether or not anyone went to Mecca.
The account is that he slept with his feet toward the Kaaba, was rebuked for it, and asked to be turned to where God was not.
It is the best known of the janamsakhi episodes and the most theologically compressed: the argument is finished in one sentence and no doctrine is stated.
Whether the journey took place is not established and the tradition treats the question as beside the point. What is recorded elsewhere is that he travelled a very long way west.