Some ideas
I have a good amount of experience with repairing iPhones so here is some input regarding the turn off problem.
1. The most likely cause is the battery especially in an older phone. The battery can age in a way where it appears to be charged but has very little ampacity. When the phone attempts to do an operation that requires too much current the voltage drops and the phone reset circuitry kicks in. This is why phones start resetting at increasing levels on the charge display as the condition of the battery continues to degrade. The charge measurement circuitry of the phone would not be able to distinguish this problem. If you look at the customer forums on Amazon you will see that a fairly high percentage of the replacement batteries have problems. The equipment manufacturers (such as Apple) test for this by running a load test so it is fairly rare to see a problem with a new phone. If you buy a replacement battery for something like $5 I seriously doubt that it was load tested. Battery replacement can be done DIY but do not assume that it is easy. There are many parts that interlock to pass signals so it essential to be exact. The video of the girl carelessly popping things apart is very misleading. The touch screen connector is tricky and be extra careful when removing the port connector as there are delicate parts right next to it that can be damaged. If you follow the forums there are plenty of posts regarding problems that resulted from careless repairs.
2. Internal connection problems caused by liquids or other contamination. There are many connection points for power feeds that rely on simple pressure contacts. The phone is not liquid tight so situations that allow liquids into the phone can contaminate the connectors and foul the distribution of power. BTW the primary battery connection to the mother board is is made by spring contacts against circuit board pads. Moisture contamination is probably the 2nd cause of iPhone problems after broken screens. The symptoms of a bad connection can be exactly the same as a bad battery due to series resistance.
3. The last likely cause is a faulty on/off switch. A faulty switch (it gets pressed a lot both intentionally and not) would be the same as intentionally turning the phone off.
I hope this helps.
I have a good amount of experience with repairing iPhones so here is some input regarding the turn off problem.
1. The most likely cause is the battery especially in an older phone. The battery can age in a way where it appears to be charged but has very little ampacity. When the phone attempts to do an operation that requires too much current the voltage drops and the phone reset circuitry kicks in. This is why phones start resetting at increasing levels on the charge display as the condition of the battery continues to degrade. The charge measurement circuitry of the phone would not be able to distinguish this problem. If you look at the customer forums on Amazon you will see that a fairly high percentage of the replacement batteries have problems. The equipment manufacturers (such as Apple) test for this by running a load test so it is fairly rare to see a problem with a new phone. If you buy a replacement battery for something like $5 I seriously doubt that it was load tested. Battery replacement can be done DIY but do not assume that it is easy. There are many parts that interlock to pass signals so it essential to be exact. The video of the girl carelessly popping things apart is very misleading. The touch screen connector is tricky and be extra careful when removing the port connector as there are delicate parts right next to it that can be damaged. If you follow the forums there are plenty of posts regarding problems that resulted from careless repairs.
2. Internal connection problems caused by liquids or other contamination. There are many connection points for power feeds that rely on simple pressure contacts. The phone is not liquid tight so situations that allow liquids into the phone can contaminate the connectors and foul the distribution of power. BTW the primary battery connection to the mother board is is made by spring contacts against circuit board pads. Moisture contamination is probably the 2nd cause of iPhone problems after broken screens. The symptoms of a bad connection can be exactly the same as a bad battery due to series resistance.
3. The last likely cause is a faulty on/off switch. A faulty switch (it gets pressed a lot both intentionally and not) would be the same as intentionally turning the phone off.
I hope this helps.