MacOS: panning using the middle button is broken

Panning using the middle mouse button in windowed (or windowed fullscreen mode) on Mac isn’t usable due to the cursor moving to the bottom right corner of the screen after finishing

System:
macOS Catalina 10.15.6 (19G2021)
MacBook Pro (16-inch, 2019)
AMD Radeon Pro 5300M 4GB