So then the camera button is OK.
You are saying when you are about to take the shot, what you are seeing is an upside down image so you need to turn the phone around to have the camera button in the right place.
Very strange. Either your phone has a fault with the Gyro sensor, or it is functioning correctly. I may still be misunderstanding you.