Updating the figure using clientside callback

Hi!

I am using clientside callbacks in order to update the 3D graph based on the viewpoint of another 3D graph, i.e.
using layout.scene.camera but the graph is not updating.
This is the code:

app.clientside_callback(
    """
    function (relay_data, figure) {
        if(figure === undefined || relay_data === undefined) {
            // return {'data': [], 'layout': {}};
            return window.dash_clientside.no_update
        }
        
        console.log(figure);
        console.log(relay_data);

        var fig = Object.assign({}, figure, {
            'layout': {
                ...figure.layout,
                'scene': {
                    'camera': {
                        ...relay_data[scene.camera]
                    }
                }
            }
        });

        console.log("figure created");
        console.log(fig);

        var element_id = document.getElementById("3dgraph_pred");
        console.log(element_id);

        return fig;
    }
    """,
    [Output("3dgraph_pred", "figure")],
    [Input("3dgraph_gt", "relayoutData"), Input("3dgraph_pred", "figure")]
)

As you can see, the idea is to update the 3dgraph_pred figure using relayout data from another figure.

Thanks in advance