Chosen Solution

To rule out a software problem (which is always a good thing to do before starting to replace components), first restore the iPhone cleanly from dfu mode using iTunes (there are many guides for this available on YouTube, search for iPhone DFU mode). Then, to rule out a problem in your profile, don’t restore anything from a backup. This will leave the iPhone as clean as possible, as if it left the factory (from a software point of view). Use it in that state for a while and see if the problems persist. If not, it’s a software fault, and I would advise to work with this clean install. if the problem persists after a clean install from DFU mode, it points towards a hardware issue, and the battery itself may indeed be at fault. Replacing it would be a good starting point then.

that’s why so many people tell me that I should not buy iphone X because it usually has errors relate to battery, even though they tell me it is fixed and won’t happen any more but still better buy other versions friv