This is normal behavior and is another way for Apple to discourage people from repairing their own devices. A warning is displayed in the introduction of the iFixit guide for battery replacement on this phone. If your phone is acting normally, you can safely ignore this warning.
Keep in mind that Apple continues to make moves like this that hurt the repairability of their products. Replacing the screen, battery, home button (if applicable), and/or front sensor assembly (on iPhones with Face ID) will trigger a message or cause some functions not to work on many iPhones and other Apple devices. Some tools, like the JC V1S, will restore the battery health functions but may not remove the "battery may not be genuine" message.
Serialization of parts is one of the things trying to be fixed by "Right to Repair" laws. You can learn more about Right to Repair under the Advocacy section on the footer of the iFixit website.