Please check the syntax:
frappe.ui.form.on('DocType', {
refresh: function(frm) {
frm.add_custom_button(__("Your Button"), () => {
// your logic
}, __("Create"));
frm.page.set_inner_btn_group_as_primary(__("Create"));
}
});
Please set your doctype name and button name in the script.