I have traveled to a destination and used the compass on my cell phone and it tells me direction of qibla and I prayed fajr and maghribain according to it. However when i came to the second floor of the same house the compass pointed in the opposite direction for the qibla. Should I re do Fajr and maghribain?

Before you redo your Salaat check which one was the right direction first floor or second floor. Redo the one which was in total opposite