Is it an older MacBook? It looks like at some point this was a known bug, as there are lots of threads and articles about this issue online.
This person took it upon themselves to write some code to fix the issue:
There are numerous fixes you can try in those articles. Looking through the threads, some work for certain people while others do not. If an OS update is available for the device, I would try installing that first.