Hammerspoon. But I disabled it and can still reproduce the problem.
Why I think it’s BTT is that as soon as I restart it from the menu bar, clicks aren’t received for 3 seconds. It must be something in the hid event loop.
the event loop works differently, but it can be a problem in one of the event taps.
It happens if the system is unable to deliver the events in time. This is if one or multiple tapping processes are taking too long to process events, however BTT usually is pretty fast unless some conflict with other tapping apps happen or the system is under very heavy load. Unfortunately this stuff is really hard to debug.
Possibly try whether it also happens with an empty BTT preset