State update not happening when App not "running"

I have a weird situation. My wife and I both have iPhone 11’s running iOS 17.2.1 and the latest iOS HA app.
I have an automation that turns off our bedside lights when the phone’s battery switches to ‘Charging’ after 10pm.
In the last 2 weeks (maybe 3?) my wife’s phone does not update HA when the App isn’t running. Prior to the last 2 (or 3) weeks everything worked perfectly.
My phone doesn’t experience this issue. The battery state is updated whether the App is open or not.
I’ve verified that the Home Assistant App settings are the same on both phones.

So an update on this. It turns out that the Battery state isn’t changing. The Battery state remains at ‘Not Charging’ until magically a few hours later it changes to ‘Full’.

This is History graph for my wife’s phone from later yesterday morning until earlier this morning (not quite 24 hours). The phone was plugged in and the phone was indeed charging.

I was able to sort this out.

Somehow the external address in the companion app got replaced by the internal IP, and the Internal address field was blanked.
It is interesting that everything worked as it should when the App was open, but somethings that needed background refresh didn’t work when the App was closed.