

Not really. Theoretically you can use Google Maps as a compass, but otherwise no. Per the article:
Shockingly, Google is yet to build its own native compass or level tool app for Android. Most third-party phone makers have taken matters into their own hands, but modern Pixel phones still don’t provide a user-facing app for accessing coordinates, altitude, magnetism, and other useful metrics. Thankfully, Compass has you covered.
Hmm cause… It could be the battery. Or maybe the battery is fucked. If that’s not the case they could probably have a look at the battery and see if it failed.