System call powerSource

We have few boron 404X devices installed at various locations powered by Lithium battery.
An external RTC based module wakes up Boron 404X module 4-8 times per day (depending on programmed alarm schedule) to send information. Once information sent Boron 404X turns off its cellular and few seconds later shuts its own power off by pulling Enable Pin (simple FET circuit).

For 1-2 years everything was OK. Battery lasted for almost 12 Months.

Later In firmware we implemented if System.powerSource() == POWER_SOURCE_BATTERY it should cut its power off by pulling (Through FET circuit) Enable pin and if System.powerSource() == VIN leave Enable pin Enabled.

We found that System.powerSource() some time reported incorrectly that has caused boards to stay awake and discharging the battery.

Some site are still going for almost 5 Months and some site battery didn't last a week. It is confirmed that board stays awake causing battery to discharge and System.powerSource() is in question???
Any input will be highly appreciated.
Device Boron404x OS = 4.2.0

It's hard to say for sure, but how are you handing the POWER_SOURCE_UNKNOWN case? Do you know what the power state was instead of POWER_SOURCE_BATTERY?

If the device is not powered by USB or VIN, then it will either be battery or unknown. There will be a window of time where the battery is not known if the battery is present or not, and the result will be unknown. But usually it will become known after a short period of time.