Hello.
The Camera button should stay next to the Home button / bottom end.
The 'Auto' on the other end, and the settings icons will rotate with the screen but stay in position.
Do the camera / video / mode icons stay next to the home button below the screen? It is hard to tell with the screenshot you posted.
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.
OK - Looking at your screenshot again you have shown the orientation but the settings icons have not moved. I can't see a way to show that shot other than there is a fault with the sensor.
On some Samsung versions you can run a test on the Gyroscopic Sensor by dialing *#0*#.