If this becomes confusing for them, and they are in a location where it is possible to know it, yet they were negligent until they prayed facing other than the Qiblah, whether in Makkah or wherever they may be while being able to observe the Ka'bah from there, then they must repeat it if they learn of that.(1)
If the Qiblah becomes confusing to an Imam during some of his prayer, and then it becomes clear to him that it was other than the Qiblah, he shall not count what has passed and must restart the prayer." He said: "And such is the case for a blind person if he has someone to guide his sight."
He said: "If he is outside of Makkah in other lands where the Qiblah is obscured and he is unable to observe it directly, and he exerted effort (ijtihad) in seeking the Qiblah, then it became clear to him during part of his prayer where the exact Qiblah was, until he became certain of it, then he is like one who prayed in Makkah; and the same applies to the blind person."
1161 - 'Amr ibn 'Uthman narrated to us, saying: Al-Walid narrated to us, saying: Abu 'Amr said: "If he prayed while deviated from the Qiblah but remained within what is between the West and the East, and he realizes this during the remainder of the prayer, he should turn toward the Qiblah and count what he has already prayed. If he does not realize it until he finishes his prayer, then his prayer is complete."
• It was said to Ahmad: A man prayed in the Sacred Mosque (Al-Masjid al-Haram) while having deviated from the House (the Ka'bah)? He said: "It does not suffice him."
1162 - Ahmad ibn Hanbal narrated to us, saying: Hammad ibn Mas'adah narrated to us, from 'Ubayd Allah, from Nafi', from Ibn 'Umar, that 'Umar said: "Everything between the East and the West is a Qiblah, except at the House."
(1) Thus it is in the original, and it is possible that there is an omission in it.