This sound like the →"pan border" issue that has been there almost forever. It is not due to a faulty trackpad (but more likely to trigger) because it can be reproduced by mouse. Maybe it is an unfortunate event handling design when the pointer moves over the edge between viewport and UI.
Ensure that the button pressed state is properly released. On a trackpad you can do a superfluous extra tap in the viewport after releasing the finger, just to make sure the drag action is completed.