Mouse right click intermittently stops working on macOS
In fact it was a hardware issue. I confirmed this by waiting for the behaviour to reappear, then plugging the mouse into a different computer. (See comments below the question).