I wonder whether this could be a touchpad malfunction, causing phantom clicks that move focus. To diagnose, you could temporarily disable it and use an external mouse.
a touchpad malfunction that only happens after an OSX update?
External mice also suck with macOS though.
a touchpad malfunction that only happens after an OSX update?