@Mjhoworth
I reviewed your post and I understand that the computer is turning off when you unplug the charger.
Don’t worry, I assure you I will try my best to get this sorted.
As you have mentioned that you are facing the same issue with the new battery as well then it looks like an issue with the battery connection.
I recommend you contact support and check the available service options for your computer.
Here is how you can get in touch with support.
1)Click on this link – www.hp.com/contacthp/
2)Select the product type.
3)Enter the serial number of your device or select let HP detect your product option.
4)Select the country from the drop-down.
5)You should see the HP phone support number or Chat option listed.
Let me know how it goes and you have a great day!
P.S: Welcome to the HP Support Community 😊
If you wish to show appreciation for my efforts, mark my post as Accept as Solution. Your feedback counts!
Cheers!
Stay Home – Stay Safe
The_Fossette
I am an HP Employee