Sayyiduna Abdullah bin Abbas (may Allah be pleased with them both) narrates: When the Qiblah was changed, some people said: O Messenger of Allah! What will happen to our companions who used to pray facing Bayt al-Maqdis and then died in that state? Allah Almighty revealed this verse: {وَمَاکَانَاللّٰہُلِیُضِیْعَاِیْمَانَکُمْ} … Allah Almighty is not one to waste your prayers.
Hadith Referenceالفتح الربانی / أبواب تفسير القرآن وفضائل السور والآيات حسب ترتيب النزول / 8492