This is not a bug, just a common mistake. Follow the events from top to bottom.
On clicked and mute equals 0: set mute to 1 and set silent
On clicked and mute equals 1: yep, just did that in the previous event, so set mute to 0 and set not silent.
So each time you click the button it instantly mutes then unmutes.
Just use the 'toggle mute' option instead.