Oh, FFS…it's my mouse! My stupid Microsoft Precision Mouse that has already been replaced under warranty once! When I use my wife's mouse, it no longer happens. My mouse is connected via a USB cable, and the issue reproduces on a fresh install of macOS Sonoma with zero third-party software installed. So it has to be a hardware issue with the mouse—a hardware issue that only manifests when more than one user is logged in and window dragging happens with other visible windows, which is wild!