Sure Al-Baqara

2:143

وَكَذَٰلِكَ جَعَلْنَٰكُمْ أُمَّةًۭ وَسَطًۭا لِّتَكُونُوا۟ شُهَدَآءَ عَلَى ٱلنَّاسِ وَيَكُونَ ٱلرَّسُولُ عَلَيْكُمْ شَهِيدًۭا ۗ وَمَا جَعَلْنَا ٱلْقِبْلَةَ ٱلَّتِى كُنتَ عَلَيْهَآ إِلَّا لِنَعْلَمَ مَن يَتَّبِعُ ٱلرَّسُولَ مِمَّن يَنقَلِبُ عَلَىٰ عَقِبَيْهِ ۚ وَإِن كَانَتْ لَكَبِيرَةً إِلَّا عَلَى ٱلَّذِينَ هَدَى ٱللَّهُ ۗ وَمَا كَانَ ٱللَّهُ لِيُضِيعَ إِيمَٰنَكُمْ ۚ إِنَّ ٱللَّهَ بِٱلنَّاسِ لَرَءُوفٌۭ رَّحِيمٌۭ

Und so haben Wir euch zu einer Gemeinschaft der Mitte gemacht, damit ihr Zeugen über die (anderen) Menschen seiet und damit der Gesandte über euch Zeuge sei. Wir hatten die Gebetsrichtung, die du einhieltest, nur bestimmt, um zu wissen, wer dem Gesandten folgt und wer sich auf den Fersen umkehrt. Und es ist wahrlich schwer außer für diejenigen, die Allah rechtgeleitet hat. Aber Allah läßt nicht zu, daß euer Glaube verloren geht. Allah ist zu den Menschen wahrlich Gnädig, Barmherzig.

Tafsir 2:143

Just as I made a direction of prayer for you, I have chosen you to be a good, just and balanced nation from among all the communities: in your beliefs and your ways of worship and in your transactions, so that you will be witnesses for the prophets of Allah on the Day of Judgement, confirming that they delivered the messages Allah instructed them to deliver to their people; and so that the Prophet Muhammad (peace be upon him) will also witness that he delivered his message to you. Allah changed the direction of prayer that you used to face (Jerusalem) to demonstrate who was content with Allah’s decree, willingly doing as He instructed and following the Messenger; and to also demonstrate who turned away from his religion, following his own desires and not obeying Allah’s sacred law. The first change of prayer direction was difficult, except for those who Allah granted faith to and who were certain that whatever He decrees for His servants has far reaching wisdom and underlying reasons behind it. Allah will not make you lose your faith in Him, or your good actions, including the prayers you prayed before the change of prayer direction. Allah is kind and compassionate with people, not overburdening them, and they will not lose the reward for their actions.