The Messenger of Allah ﷺ and his companions prayed toward Bayt al-Maqdis for sixteen months, then the qiblah was changed afterward.
حدثنا حسين بن علي عن زائدة عن سماك بن حرب عن عكرمة
صلى رسول الله ﷺ وأصحابه إلى بيت المقدس ستة عشر شهرا ثم صرفت القبلة بعد
Its isnad is sahih. It is found in Durr Manthur 1:142, attributed there only to Tabarani. Its meaning will come at greater length under 2993, by way of Amash from Mujahid from Ibn Abbas, and it is also found in Durr Manthur as well as Zawaid 2:12. See also Tarikh Ibn Kathir 3:252-254.