Updating Plotly's updatemenus using Dash Patch() bug

I am using Plotly’s updatemenus to hide certain traces based on a dropdown menu (the trace to be hidden is pre-determined in my minimal code example below for simplicity). I have a callback that updates which traces should be hidden when the updatemenus button is pressed using the Patch() functionality from Dash to only update this button and not the whole figure. However, I found that the button is updated only after it was pressed two more times.

from dash import Dash, html, dcc, Input, Output, Patch, callback, State
import plotly.graph_objects as go

app = Dash(__name__)

fig = go.Figure(
    [
        go.Scatter(x=[0, 1, 2, 3, 4, 5, 6, 7, 8], y=[0, 1, 3, 2, 4, 3, 4, 6, 5]),
        go.Scatter(x=[0, 1, 2, 3, 4, 5, 6, 7, 8], y=[0, 4, 5, 1, 2, 2, 3, 4, 2]),
    ],
)

fig.update_layout(
    updatemenus=list([
        dict(
            buttons=list([
                dict(label='Hide/show bad channels',
                    method='restyle',
                    args=[{'visible': [True, True]}],
                    args2=[{'visible': [False, True]}]
                ),
            ]),
            direction = 'left',
            showactive = False,
            type = 'buttons',
            xanchor = 'left',
            yanchor = 'top',
            x = 0,
            y = 1.08,
        )
    ])
)

app.layout = html.Div(
    [
        html.Button("Update", id="update-button"),
        dcc.Graph(id="graph-example", figure=fig),
    ]
)


@callback(Output("graph-example", "figure"), Input("update-button", "n_clicks"))
def hide_data_patched(n_clicks):
    patched_fig = Patch()

    if n_clicks:
        patched_fig['layout']['updatemenus'][0]['buttons'][0]['args2'][0]['visible'] = [False, False]

    return patched_fig


# @callback(Output("graph-example", "figure"), Input("update-button", "n_clicks"), State("graph-example", "figure"))
# def hide_data_full(n_clicks, current_fig):
#     if n_clicks:
#         current_fig['layout']['updatemenus'][0]['buttons'][0]['args2'][0]['visible'] = [False, False]

#     return current_fig


if __name__ == "__main__":
    app.run(debug=True)

In my minimal code example, you can see that pressing the “Hide/show bad channels” button hides one of the traces. Pressing it again shows all channels. Using the “Update” button, the “Hide/show bad channels” button is updated to hide all channels. However, after pressing the “Update” button, you have to click the “Hide/show bad channels” button two more times before the changes take effect.
When commenting out the callback and un-commenting the one below, where I return the whole figure instead of using Patch(), it works correctly. However, because the figure (in my actual project) contains a lot of datapoints, returning the whole figure is highly inefficient and using Patch() would be much preferred.

Therefore, I am wondering whether I am using Patch() incorrectly or whether this is a bug. And if it is the latter, whether there are any workarounds I could use to make this work correctly.

Thank you in advance!