We prayed with the Prophet ﷺ facing Bayt al-Maqdis for sixteen or seventeen months. Sufyan was uncertain which. Then he was turned toward the Kaaba.
أخبرنا محمد بن بشار قال حدثنا يحيى بن سعيد حدثنا سفيان قال حدثنا أبو إسحق
صلينا مع النبي ﷺ نحو بيت المقدس ستة عشر شهرا أو سبعة عشر شهرا شك سفيان وصرف إلى القبلة
Bukhari, Tafsir, chapter: "To each is a direction to which he turns," h: 4492, and Muslim, Masajid, chapter: the changing of the qibla from Jerusalem to the Kaaba, h: 12/525, narrated it from the hadith of Yahya Qattan through this chain.