I saw the documentation of making ajax call in Frappe :
frappe.call({
method: "",
type: "POST",
args: {},
success: function(r) {},
error: function(r) {},
always: function(r) {},
btn: opts.btn,
freeze: false,
freeze_message: "",
async: true,
url: "" || frappe.request.url,
});
In this success and error function is not triggering after getting the response.