Our local apple dealer recommended to replace the tip, in my case it worked. Pencil had fallen and landed on the tip before, causing it to deform slightly. Seemingly the correct and stable distance of the electrode inside the tip to the iPad‘s surface is important.
Hi, I don't know what iPad you have but this could happen in some cases when charging and using the iPad at the same time. Especially with the first generations iPads and Apple Pencil 1st. generation.
Are you using Procreate when this happens or does it happens in other programs too?