The intermittent, unresponsive touchscreen issues with higher priced, larger screen iPad Pro and iPad Air modrls are a well known and well documented here in the iPad support communities.
This affects a still small, but contuning growing minority of random 2017 through present iPad Pro and iPad Air models and its user base.
After nearly 3 years of this nonsense, there is still no confirmed cause and fix/solution from Apple.
NONE!
Getting one of there defective units is very random and one of a handful of issues going on with higher priced, larger scfeen iPad models that has prevented me from purchasing a new iPad Pro or new iPad Air for the past 2-3 years.
This touch screen issue is probably THE reason this seller sold you this iPad Pro to begin with.
Apple and Apple support have no real fixes or solutions to this issue.
If you have a screen protector on this iPad Pro, remove it as this makes the touch screen and Pencil experiences worse.
If you can't deal with this touch screen issue, and you haven't had this purchased, used iPad Pro long, consider returning this 2017 iPad Pro from where you purchased from and get all of your money back!
There is absolutely no solution/s to these later iPad Pro/iPad Air touch screen issues.
Purchase a new or refurbished iPad from Apple and get paid, extended AppleCare+ for this new or refurbished iPad so, that if you end up with a glitchy touch screen iPad Pro or iPad Air model, your new of refurbished iPad from Apple is fully covered for any type of issue or user incidental or accidental damages.
So Sorry & Best of Luck to You!