Reference: Fataawa Muhimmah tata’allaq bis-Salaah – Question No.5, Pages 6-7
Question: What is the ruling [in a situation] where it has become apparent the prayer was performed in other than the direction of the qiblah – after having made ijtihaad? And is there a difference between whether this was in a Muslim country or not?
Response: If a Muslim is travelling, or in a country where it is not easily possible to find someone who can show him the direction of the qiblah, then his prayer is correct if he made ijtihaad in investigating the direction of the qiblah – [even if] thereafter it becomes apparent he has prayed in other than the direction of the qiblah.
If, however, he was in a Muslim country, then his prayer is incorrect; that is because it is possible for him to ask someone to guide him to the direction of the qiblah, just as it is possible for him to find the direction of the qiblah by way of the masaajid.