Maimonides, in his Laws of Prayer (Mishne Torah, Hilkhot Tefillah 5:11) provides an analogy for a prayer-related Jewish custom, whereby one concludes his Amidah by bowing first to his left and then to his right. In his opinion, this is because the one at prayer is facing God, and just as one first bows to the right side of a king before taking leave and only afterwards to his left side, so one should do likewise when taking leave of the divine:
Because one's left is to the right [side] of His countenance; i.e., just like when one stands before a king, he takes leave from the right of the king, and then afterwards from the left of the king. Thus, they established that one should withdraw from the Amidah in the same manner as he withdraws from before a king.
[English taken from Eliyahu Touger's translation, which is online.]
Maimonides' source for this custom is the Talmud (Yoma 53b, which can be viewed here), but the Talmudic source never mentions the idea that this is also how one takes leave of a human monarch. To the best of my knowledge, Maimonides' text is the earliest source for this particular idea.
Is there any historical basis to this? Maimonides lived in the 12th century, both in Spain and in Egypt. Was it ever the case in either of those places (or in other, earlier places of which Maimonides might have heard) that a person departing from a king first bowed to one side of him (perhaps to a minister or prince who stood at one side of him) and then to another?
It is entirely possible that Maimonides is making this up, in an effort to find a rational explanation for a Talmudic law, but if there is an historical basis that would be fascinating - and this seems like the best place to ask!
The Wikipedia article on Maimonides can be viewed here.
The Wikipedia article on this prayer (the "Amidah") can be viewed here.