Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:2:145

And if you brought to those who were given the Scripture every sign, they would not follow your qiblah. Nor will you be a follower of their qiblah. Nor would they be followers of one another's qiblah. So if you were to follow their desires after what has come to you of knowledge, indeed, you would then be among the wrongdoers.  

Yet if (wa-la-in: the lām is for oaths) you should bring to those who have been given the Scripture every sign, about your truthfulness in the matter of the direction of prayer, they will not follow your direction, out of obduracy, and you are not a follower of their direction (this is a categorical negation of his ˹the Prophet’s˺ desire that they become Muslims and of their desire that he return to their direction of prayer; neither are they, the Jews and the Christians, followers of one another’s direction. If you were to follow their whims, the ones to which they summon you, after the knowledge, the revelation, that has come to you, then you, if, hypothetically, you were to follow them, will surely be among the evildoers.
القرآن:٢:١٤٥

وَلَئِنْ أَتَيْتَ الَّذِينَ أُوتُوا الْكِتَابَ بِكُلِّ آيَةٍ مَا تَبِعُوا قِبْلَتَكَ ۚ وَمَا أَنْتَ بِتَابِعٍ قِبْلَتَهُمْ ۚ وَمَا بَعْضُهُمْ بِتَابِعٍ قِبْلَةَ بَعْضٍ ۚ وَلَئِنِ اتَّبَعْتَ أَهْوَاءَهُمْ مِنْ بَعْدِ مَا جَاءَكَ مِنَ الْعِلْمِ ۙ إِنَّكَ إِذًا لَمِنَ الظَّالِمِينَ  

{ولإن} لام قسم {أتيت الذين أوتوا الكتاب بكل آية} على صدقك في أمر القبلة {ما تبعوا} أي لا يتبعون {قبلتك} عناداً {وما أنت بتابع قبلتهم} قطع لطمعه في إسلامهم وطمعهم في عوده إليها {وما بعضهم بتابع قبلة بعض} أي اليهود قبلة النصارى وبالعكس {ولإن اتبعت أهواءهم} التي يدعونك إليها {من بعد ما جاءك من العلم} الوحي {إنك إذا} إن تبعتهم فرضا {لمن الظالمين}.