When the compass in Google Maps isn’t responding properly, like not rotating with you or keeping up with your turns, it’s usually related to calibration or some kind of permission hiccup between the phone and the app.
What might help is making sure Google Maps has full access to your location, not just "While Using the App," but set it to “Always” temporarily and see if that changes anything.
Also, go to Settings > Privacy & Security > Location Services, and check that "Compass Calibration" is turned on. That setting helps the phone adjust its internal compass to match your actual direction.
Sometimes, third-party apps like Google Maps don’t sync quite perfectly after a phone update or if the phone is super new, so the compass might need a little manual nudge to recalibrate. Try opening the Compass app that comes with the iPhone (just search for “Compass” on your home screen). Move the phone around in a figure-eight motion a few times. This could help the sensors reset and that can often fix the issue across all apps.
If none of that does the trick, it's probably not something you did wrong. You could definitely stop by the Apple Store for them to run a quick diagnostic check if the motion sensors are working properly.
If it turns out there’s a hardware issue, they’ll usually handle it right away or replace the phone if needed.