This is related to a number of existing bugs (e.g. #26153). Please see the attachement for an example of the glitch. Based on the recommendations in the other bug reports I've added (add-to-list 'default-frame-alist '(inhibit-double-buffering . t)) to my init file. Interestingly, this helped for about 30min until the issue reappeared and then persisted. The glitch typically happens when I switch buffers and then move the cursor.