What's confusing my phone?

I have a problem with my (older) Android phone and am not sure how to debug it.

Four times in the last six months, I have used the navigation in Google Maps while in a car (audio, not looking at the screen). Every time the trip has ended the same way: the app informs me that I have reached my destination, I reach for the phone to exit, and the phone crashes. On restarting, it tells me I have 1% battery and crashes again. (Phone was not low at the start of the trip.) Now here's the interesting part: when I plug it in to charge, it reports something in the range of 30-40%. So, something is confusing the phone about its battery state, because no way does my phone charge that quickly (especially on a car charger).

Here's tonight's case: I was at something over 60% when I turned on nav for a 15-minute trip. Crashed on arrival, plugged in (in the car) and turned on, it said 32%, I unplugged, and it crashed again (back to 1%). I left it off while I completed my errand, but plugged it in to charge on the drive home. At home, it was 40% and, this time, did not crash when I unplugged it from the charger.

To determine whether the problem is specific to Google Maps, I installed another navigation app (Waze). When the installation finished I opened the app...and the phone crashed. When I connected it to the charger, it said it was at 31%. I let it charge for a bit (I turned it on while it was connected to the charger), and disconnected it around 50% with no issues.

Here's all that in pictorial form:

Image without description

Also, the power manager reports no fast-drain apps. iDrive, a backup app, was a fast-drain app and is the singular entry in the history, but I've nerfed it and it hasn't popped up recently. Could its mere presence be a problem?

Now, I'm pretty sure the battery isn't actually being drained to practically nothing, because it wouldn't bounce back that quickly. And apparently it's not just Google Maps or GPS, because Waze didn't even finish opening before that crash. But something, either Android or something in hardware or firmware, sure thinks there's a problem that calls for shutting down.

How do I find it?

I have not had crashes with other apps -- though I also don't stream videos or play games on my phone, so I'm not taxing it. I have noticed the pattern of "steps" you can see in the picture here -- battery will drop noticably, then stay level for a while, then do it again. I don't know what's causing that or if it's related.

The phone is old -- ZTE Axon 7, bought in 2017, running Android 7.1.1 and apparently not eligibile for newer -- but it otherwise works, has the (rare) aspect ratio I crave, and already has all my stuff on it. I'd like to keep using it for a while (and let the 5G world sort itself out in the meantime).