These are some good tips. I’ve had this issue for a long time. Most times when using while charging but sometimes when not charging as well. Either way, very annoying. So far I’ve just tried the Touch Accommodations disabling and disabling Send iPad Analytics. Time will tell if these are permanent fixes.
macreports.com

How To Fix Your iPad Pro With Unresponsive Screen • macReports
This article explains what to do when your iPad Pro screen stops responding to your touch. The problem you are having could be: The touchscreen of your
