It sounds like your power adapter is not large enough to handle the power requirements for your laptop. When using a smaller power adapter than Apple shipped with the laptop from the factory, then the battery will drain while the power adapter is connected since the battery is making up the difference.
Or maybe, the USB-C ports are damaged or bad so the laptop is not getting the full power from the power adapter. Have you tried using the other USB-C ports (especially on the other side of the laptop) to see if there is any difference (assuming your power adapter is large enough for that specific model laptop)?
You can use a power adapter which has a higher wattage rating without any problems. If the laptop shipped from the factory with a 60W power adapter, then a 70W, 80W, 140W power adapter can be used (it won't charge any faster, but it would allow you to use it with more devices).
You can try running the Apple Diagnostics to see if any hardware issues are detected. Only a failing result is useful. Unfortunately the Apple Diagnostics don't find too many failures these days since they no longer perform proper in depth tests.
And perhaps that "refurbished" laptop was not actually refurbished at all. Unfortunately many sellers will not do anything to the laptops they receive.....maybe they will clean the dirt from them & reinstall macOS.
FYI, I do not recommend repairing any Intel Macs for multiple reasons, but especially not the USB-C Intel Macs.
If you want a Mac, then I would suggest avoiding any of the USB-C Intel Macs for multiple reasons. Get an M-series Mac instead, but be careful buying used since there are many unscrupulous sellers and a lot of innocent sellers who don't properly prepare a Mac for sale & you may find that someone else is still managing that used Mac. Buyer beware.
What to do before you sell, give away, trade in, or recycle your Mac - Apple Support
If you want to buy refurbished, then make sure the vendor has an excellent reputation for actually refurbishing the devices & performing proper testing (running Apple Diagnostics is not enough).
If you want to buy a properly refurbished Mac, then check out the official Apple refurbished options.....they will vary depending on what has been traded in by users:
Refurbished Mac Deals - Apple
You can also check out OWC's refurbished Macs (OWC has been a respected vendor supporting Apple products for decades):
https://eshop.macsales.com/shop/Apple_Systems/Used/Macs_and_Tablets