I found an additional solution to this issue. I am using a Macbook Air M1 with Logitech M720 mouse and Apple wired keyboard with external Apple monitor. I sometimes use the Macbook with mouse only. I have the mouse buttons set for shortcuts like "Desktop" and "Mission Control", etc. Like others, my mouse buttons would work and then stop working and I would have to revert to keyboard shortcuts instead of mouse buttons. The solution I found involves going into Settings>Security&Privacy>Privacy>Input Monitoring where you uncheck the "Logi Options Daemon". I am guessing you can uncheck "Logi Options+" as well, if you have it installed. I think this is what @Tom_CH_CH was getting at in his earlier post. See below. I also unchecked "Universal Control" as suggested by @Berts89. All is working now. Mouse buttons are golden.