Additionally, it is mentioned that if someone prays facing the wrong direction (not toward the Qibla) on a cloudy day and later realizes their mistake: if they prayed within the correct prayer time, they should repeat the prayer. However, if the time has passed, they are not obligated to repeat it, as their effort was based on due diligence.
Commentary #5