Hmm … to be honest, I don’t believe there’s a particular set of apps that is responsible, or at least, there’s no pattern I could spot on my system. It happens when I’m using apps from the Affinity range, FontLab 8, Sketch, sometimes even when I’m using built-in apps like Preview. Users elsewhere report the occurence of the bug in apps from the Adobe Creative Suite, in Figma, … you name it. In any event, it’s a really unnerving bug.
As for solutions, there are two that work quite reliably for me: (a) first (and always working), toggling the Pinch to Zoom switch in System Settings > Trackpad > Scroll and Zoom, (b) secondly (most always working), pressing the Touch ID button on my keyboard to lock the system, then the escape button to send the computer to to sleep, and finally pressing Touch ID again to wake the system up again.