Apple pencil glitch
I have been trying to solve the apple pencil glitch were it draw lines thanks to static electricity, I've tried everything I found and the only think int work for me was turning of the option of drawing with the fingers, that option you fiend when you're going to edit a pdf on your files and the menu to select different pens appears, in the 3 points ... Turn off drawing with the fingers and if still happens turn off Hover preview.
In the middle photo you can se the bug/glitch. I hope it fixes it for you to.
Apple Pencil (2nd generation)