Apple Pencils are delicate writing devices.
You may have damaged the internal sensor/transducer rod/tube or some other internal component.
Apple Pencils are not repairable.
Apple will only replace Apple Pencils.
Replacement of your Apple Pencil may be mandatory, now.
If your Apple Pencil is still under its free one-year warranty period or two-year AppleCare+ paid, extended waranty, you are still entitled to a free replacement Apple Pencil from Apple.
Otherwise, you will need to purchase another new Apple Pencil.
Use the “Get Support” link, at the upper right hand corner of every Apple Support Community Webpage to attempt to schedule an appointment with your nearest Apple Store location and bring in both iPad your defective Pencil.
Apple Store employees will be glad to help/assist you with getting another replacement Apple Pencil.
Test this Pencil in the Apple Store before you leave the store to make sure both your iPad and replacement Pencil are working together.
Sorry and Best of Luck to You!