If your replacement Apple Pencil discharges while docked with the inductive charging port of the host iPad, then your iPad may itself have a fault.
Starting at the beginning, try a forced-restart of your iPad - as this will often clear an isolated software issue:
Force restart iPad (models with Face ID or with Touch ID in the top button)
If your iPad doesn’t have the Home button, do the following:
- Press and quickly release the volume button nearest to the top button.
- Press and quickly release the volume button farthest from the top button.
- Press and hold the top button.
- When the Apple logo appears, release the top button.

If the problem persists after performing the restart, it may be necessary to reset your iPad settings. While this reset will not cause any loss of data, as a precaution, it is always wise to ensure that you have a current iCloud or iTunes backup before performing the reset:
How to back up your iPhone, iPad, and iPod touch - Apple Support
When you are happy to proceed, you can perform the reset from iPad settings:
Settings > General > Transfer or Reset iPad > Reset > Reset All Settings
If the problem still doesn’t clear, the next step is to reset the iPad to factory settings:
Restore your iPhone, iPad, or iPod to factory settings - Apple Support
If you still cannot resolve the problem, you would be best advised to visit the Genius Bar at your local Apple Store or Apple Authorised Service Provider (AASP) - where the technicians will be able to test and assess your iPad - and you can explore your available options for repair:
Genius Bar Reservation and Apple Support Options - Apple