The Prophet ﷺ forbade facing either of the two qiblahs when relieving oneself.
حدثنا عبد الرزاق قال أخبرنا ابن جريج قال أخبرني عمرو بن يحيى الأنصاري عن أبي زيد مولى ثعلبة أخبره
أن النبي ﷺ نهى أن تستقبل القبلتان للغائط والبول
No references are available.
Its chain of transmission is daif, due to the unknown status of Abu Zayd, the freed slave of the sons of Thalaba. This has already come up in 23536, 17767, and 17765, and it should be added that it is found in Ibn Abu Shayba 1/150. There is already a report that contradicts this, that when the news reached the Prophet ﷺ that people found this objectionable, he said, "Turn my seat around." However, many jurists have held that the matter was settled on the position that facing the qibla while urinating or defecating is objectionable.