MacBook Pro keep on "unplugging" battery and need SMC/PRAM reset
Check if your charger might be dying.

I recently had to change the charger of an old MacBook, after experiencing very similar issues and eliminating all sorts of other possible problems. I even bought a new battery (yes, it was that old). I was about to give up on the device, thinking the motherboard was dead or something.

As a last resort I went to a local store and asked to try charging it with a new MagSafe charger. The device has been happily working again ever since.

Try doing the same; it's basically free to try if they have a relevant charger in stock.