Reload list in callback func when use frappe.call not working properly

frappe.listview_settings['test'] = {
    onload: function(listview) {
        listview.page.add_button(__('Sync data from firebase'), function() {
            handleSync()
        }).css({"color":"white", "background-color": "#40e0d0", "font-weight": "800"});
    }
};

const handleSync = () => {
    frappe.call({
                method: 'firebase.api.sync_firestore_to_doctype',
                freeze: true,
                callback: (r) => {
                        const refreshButton = document.querySelector('button[data-original-title="Reload List"]');
                        if (refreshButton) {
                            refreshButton.click();
                        } 
                        frappe.show_alert({message: __("Woohoo, Sync done"), indicator: 'green'});
                },
                error: (r) => {
                    frappe.show_alert({message: __("Ops, Sync error"), indicator: 'red'});
                }
    });
}

with the first click on “Sync data from firebase”, refreshbutton was not clicked but second time when click “Sync data from firebase”. refreshButton was click.

and in some cases where the network is slow, the first time you click on “Sync data from firebase”, the “ref” button will also work correctly.