(Imām Bukhārī narrates): Ahmad bin Sa'id narrated the hadith to us, he said: Habban narrated the hadith to us, he said: Hammam narrated the hadith to us, he said: Anas bin Sirin narrated the hadith to us, he said:
when Hazrat Anas (Allāh be pleased with him) came from Sham, we went to welcome him, we met him at the place of Ain al-Tamr, so I saw him offering prayer upon a donkey, and his face was in this direction, that is, towards the left side of the Qiblah. I said to him: I see you offering prayer in a direction other than the Qiblah. He said: If I had not seen the Messenger of Allāh ﷺ offering prayer in this way, I would not have offered prayer.
Ibn Tahman has narrated this hadith from Hajjaj, from Anas bin Sirin, from Hazrat Anas (Allāh be pleased with him), from the Prophet ﷺ.
Reference: Sahih Al Bukhari 1100