Right out of the box on 9/17, my iPhone 7 Plus I noticed the Compass was off and varied from 15° to 60° to the West. This was consistent whether I was on WiFi or via LTE. I expected it to correct and reset, which it did not. I did notice Waze and Maps behave a bit odd too, but usually it was not in the order of such a large variance.
After a week, I called Apple CS and spent about an hour on the phone with the guy trying to resolve the issue. He had had me go through many settings and rebooting cycles. Eventually, he scheduled me for a Genius Bar visit. He wasn't sure if it would be a replacement or in house repair.
3 days later on the morning of the appointment, I checked and it was working correctly so I cancelled the appointment.
Over the years of using TomTom and a few other stand alone portable GPS units, I'd notice odd variances that usually corrected in a day or 2. This did not happen with the iPhone 7 Plus.
I'm not sure if my experience is related to the OP's topic question, but it did sound similar to my experience.