I've noticed many people walking backwards when taking leave of the Kosel.
Is there any halachic source for this custom?
Q: Is it permissible to turn one's back to the Kotel?
A: It is permissible just as in a shul it is permissible to turn one's back to the Torah ark. When one leaves the Kotel, the custom is to walk backwards with his face towards the Kotel until he reaches the Plaza. This was the custom of the Steipler [Gaon] (Orchot Rabbenu vol. 1 p. 320 and vol.2 pp. 150-151) and also Ha-Rav Neventzal.
Although Ha-Rav Shlomo Zalman Auerbach was not particular to do so. Ha-Kotel Ha-Ma'aravi – Halachot U-Minhagim p. 40).
Perhaps we can suggest the source for this practice is application of what the Magen Avraham OC 132:6 writes in terms of leaving shul:
כשיצא מבה"כ לא יצא ואחוריו להיכל אלא יצדד וכן בירידתו מהתיבה
When one leaves shul they shouldn't leave with their back facing the Heichal rather they should walk to the side [ie backwards].