I have this same issue with my 10.5. What ALWAYS seems to fix it (temporarily) is to completely clean the screen with a microfiber cloth. My theory is that the new high-refresh-rate screen introduced on the second gen 12.9 and the 10.5 is more sensitive to touch than previous iPad screens, and therefore begins to sense dirt and grime on the screen even when the screen is only slightly smudged. It senses this dirt/grime as if there are other fingers touching the screen, which causes the screen to sometimes become unresponsive or become jumpy instead of having normal smooth movements.
This would also explain why the Apple Pencil always works fine, which is that it has palm rejection, thus rejecting the dirt/grime which otherwise would cause the issue.
Typically if I exit the app and go right back in (no need to even force quit the app), that will do the trick. I think that causes the touch screen to reset itself. Eventually if I don’t clean my iPad screen for a few days, it will happen more and more often, and will seem as if the screen is very glitchy. However, cleaning the screen once again restores its function to like-new again, at least for a few hours of use until the problem resurfaces.
I’ve considered getting a tempered glass screen protector with an oleophobic coating as a possible fix. Has anyone who has this issue tried using a screen protector? In theory, that could solve the issue (if my theory is correct).