I don't know where the hazard warning button is located on your car. On my 123 cars it is in the console and subject to getting dirt, spilled coffee, etc. into it. It is easy to replace, but as previous posters said, operate it a few times and see if the problem goes away.
I bought a new switch some time ago, only to fix it by actuating it a few times. I now have an extra switch.
'84 Euro 240D, 516K miles
'88 300E 5 Speed
'81 300D Daughter's Car
Over 800,000 miles in