The bug
Clicking a settings button when there's a slider under the mouse in the next screen plays the "click" sound twice.
Example
Here is an example in video:
[media]Additional note
This effect is also created when you push the mouse button down, hearing a click and entering a menu, move the mouse to be on top of a slider, and then releasing. You still get an extra click.
A nice place to demonstrate this is from the Minecraft title screen: move the mouse over the Options button, press down on Left Click, continue to hold down the button while moving the mouse up to the FOV slider, then release. Extra click sound.
Also, strangely, moving the mouse to be over a slider does not produce the extra sound when entering the Video Settings menu, but does work in Options, Music & Sounds, Controls, Chat Settings, and Accessibility Settings.
Code analysis
I'm a minecraft modder, and I accidentally found the source of this bug while making a custom GUI.
The problem is, as Joey mentioned above, because minecraft is coded to play the click sound for sliders on mouse release (see: AbstractSliderButton.java, method onRelease). Because the GUI changes on the mouse press, not release, the GUI elements have changed by the time you are releasing the mouse, resulting in the repeat of the sound. This can be resolved by adding some checks around the playDownSound call to make sure you've actually been manipulating the slider.
– @unknown in this comment
This seems to affect all sliders except those in the "Video Settings" menu.