It can happen, even with a completely original iPhone that has never been opened after it left the factory. The message comes when there's any kind pairing disconnection with the battery. I understand that even installation a genuine Apple OEM salvage part from another iPhone will trigger that message, or if an Apple technician or Apple Authorized Service Provider forgets to use the equipment that "pairs" the battery to the logic board.
You can get that checked and then reset at an Apple Store, Apple Authorized Service Provider, or maybe through mail-in service with Apple. I don't believe this is something that can be reset remotely. If you have access to an Apple Store, that may be the best option since they likely won't charge for a diagnostic, and in my experience they can provide many fixes for free - even out of warranty - as long as they don't require extensive repair parts.