Inconsistent drawing will either be due to a problem with the Pencil itself, or its interaction with the iPad screen. Intermittent issues are always difficult to identify or reliably demonstrate.
Ensure that the user-replaceable Pencil tip is snugly screwed into the body of the Apple Pencil; when fitted correctly you should see a tiny gap, of about the thickness of a sheet of paper, between the tip and pencil body. If slightly loosened, or overtightened, the Pencil may not work properly, if at all.

With that said, your Apple Pencil is exhibiting symptoms characteristic of a failing battery.
The tiny internal Li-ion battery is susceptible to permanent/irreversible damage through being left discharged for long periods. Even some “new” pencils can exhibit signs of failure out-of-the-box if they are “old stock”. It is essential that if you have an Apple Pencil that you charge it regularly - whether used or not - so as to protect the battery from deep-discharge. Do not allow a pencil to remain in low-charge state for any period of time - as the internal battery will fail, rendering the Pencil useless. Setting aside an unused Pencil, for extended periods, is a recipe for premature death of the Pencil battery.
If the Pencil Battery has failed, the only remedy is to replace the Pencil. If the battery has failed and your pencil is within its one-year warranty, you should look to having it replaced by your retailer or at an Apple Store.
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 Pencil. If a fault is identified, you’ll be in the best possible place to explore your available options:
Genius Bar Reservation and Apple Support Options - Apple