Add/Remove Button script Breaks Activity Tab Lead Doctype

frappe.ui.form.on('Lead', {
    refresh(frm) {

        // Add the 'Add Task' button
        frm.add_custom_button(__("Add Task"), function(){
            console.log("Add Task button clicked");
        });

        frm.add_custom_button(__("New Opportunity"), function(){
          console.log("Clicked")
      }); 
  
      frm.add_custom_button(__("Add Meeting"), function(){
            console.log("Clicked")
      });  

        // Add the 'Send Email' button
        frm.add_custom_button(__("Send Email"), function(){
            console.log("Send Email button clicked");
        });

        var bt = ['Customer', 'Opportunity', 'Quotation', 'Prospect']
        bt.forEach(function(bt){
            // frm.page.remove_inner_button(bt, 'Create')
            frm.page.remove_custom_button(bt, 'Create');
  
          });
    }
});

Breaks Activity Tab

How to remove button successfully?

Thanks in Advance

Hi @cmdeep,

Hide/Remove button for check the documentation.

And we applied the your code but Activity tab not broken.

Thank You!