Check that your screen and screen protector are clean.
Ensure that your Pencil tip is in good condition with no signs of visible wear - and is firmly screwed into place on your Apple Pencil. If the Pencil tip is only slightly loosened, the Pencil may not operate consistently - if at all.
Should there be any signs of wear at all, replace the Pencil tip; tips are a consumable part - and are available in packs of four:
https://store.apple.com/uk/xc/product/MLUN2ZM/A
When correctly screwed into place, there should be a tiny visible gap (about the thickness of a single sheet of paper) between the body of the Pencil and the Pencil tip.
If the problem persists, remove your screen protector and re-test. If you see no improvement, your iPad screen may have a fault requiring repair. You would be well advised to visit the Genius Bar at your local Apple Store where you can demonstrate the problem to the technicians - who will able to test, assess and advise on your available options.
Genius Bar Reservation and Apple Support Options - Apple
Due to the nature of this problem, in-person diagnostics by an Apple technician is the most appropriate and effective route to a solution; remote diagnostics for this type of issue is almost impossible to perform.