Did you perform the battery replacement yourself using a third party battery? If Apple performed the battery replacement, then you have a 90 day warranty on the battery.
If you performed the battery replacement yourself, then you most likely got a defective battery, or you accidentally damaged something during the replacement, or the battery is not the issue (or the only issue).
The quality of third party Lithium batteries is extremely poor even when purchased from OWC or iFixIt.
I have seen lots of posts on these forums where the user accidentally damaged something during the repair. The Logic Board has lots of very fragile easily damaged cables & connectors plus it is easy to damage the Logic Board if not handled properly. Make sure you reinstalled the battery BMU screw and the battery flex cable. The battery flex cable can be tricky to reseat properly and the battery cable latch on the connector is easily broken. On some models the battery flex cable also has a connector on the left side as well. This flex cable is easily torn as well.
It is possible the USB-C port or ports on the laptop are bad or even damaged (I have personally seen a lot of these ports with liquid damage while supporting thousands of our organization's laptops). Unfortunately there is no reliable way of checking the USB-C ports except to physically remove them for examination since many times the corrosion cannot be seen looking into the port opening (I have missed seeing corrosion multiple times until I disassembled the laptop). Make sure to try connecting the charger to ports on the other side of the laptop. Make sure the charging cable is not loose (another design issue with the USB-C ports on the 2016 & 2017 models). Make sure to connect the charger directly to the laptop since adapters, docks, hubs may not allow the full power of the charger to reach the laptop. And disconnect all external devices in case one of them is causing a problem.
Also, here is an Apple article for troubleshooting USB-C charging issues:
If your USB-C power adapter isn't charging your Mac laptop - Apple Support
If the battery is bad, then you will need to deal with the battery vendor/seller for support.
Unfortunately identifying a defective battery is not that easy especially if using a third party battery. Also, it can be tricky to identify issues if more than one issue exists....in this case I personally would not trust a third battery...yes, that is how bad the quality of third party Lithium batteries are.
Even if the third party battery shows the same brand name as the original Apple OEM battery, it does not mean the battery is of good quality. Most times those batteries are the ones which did not meet Apple's requirements for quality. I do not know of any vendor which sells known good quality Apple OEM batteries to consumers. I don't think any exist.