@twist If the fixture is still around, you can usually fix it by changing the LED driver, when LED bulbs start to flicker usually the power voltage is not constant.
Switches could make a buzzing sound because the electrical contacts aren’t making a good connection and its arcing or it could be arcing to the electrical box. You need an electrician to look at it.