Whenever the Messenger of Allah ﷺ traveled and wished to perform a voluntary prayer, he would turn his she-camel toward the qiblah and say the takbir, then pray in whatever direction his mount was facing.
أن رسول الله ﷺ كان إذا سافر، فأراد أن يتطوع استقبل بناقته القبلة فكبر، ثم صلى حيث وجهه ركابه.
Abu Dawud (1225) narrated it from Musaddad, who said, Rubai bin Abdullah bin Jarud told us, Amr bin Abu Hajjaj told me, Jarud bin Abu Sabra told me, Anas bin Malik told me, and he mentioned it.Munziri said, "Its chain is hasan." I say, it is as he said, for Rubai bin Abdullah bin Jarud and the teacher of his teacher (his grandfather Jarud bin Abu Sabra) are both truthful.Imam Ahmad (13109) also narrated it from Yazid bin Harun, who said, Rubai bin Jarud bin Abu Sabra Tamimi informed us of the same. Here Rubai is attributed to his grandfather, though he is the son of Abdullah. However, this hadith differs from all the preceding hadiths, since it specifies that his she-camel was facing the qibla at the time of the takbir, while the preceding hadiths state without qualification that he used to pray on it facing whichever direction it happened to be turned.Hafiz bin Qayyim also raised this same objection in Zad Mad (1/476). The answer to this is that the times when the Prophet ﷺ said the takbir while facing the qibla were for the sake of travel, not for the sake of prayer, so Anas assumed that he did not say the takbir until his she-camel was facing the qibla. As for the other times when he said the takbir facing whichever direction his she-camel happened to be turned, Anas was not present on those journeys.And Allah, the Most High, knows best.