Hi,
The JavaScript on the close button might be customized in some way.
You can find the JavaScript with Ribbon Workbench.

“XrmCore.Commands.Deactivate.deactivatePrimaryRecord” is an OOTB function, which is also be called in Deactivate button in the form of some entities, such as Account or Contact.
Please check if the JS resource itself has been modified or if another command has been added to this button.
Here is a sample code snippet of a Confirm dialog.
var confirmStrings = { text:"Press A or B to continue.", title:"Confirm", confirmButtonLabel:"A", cancelButtonLabel: "B" };
Xrm.Navigation.openConfirmDialog(confirmStrings, null).then(
function (success) {
if (success.confirmed)
console.log("A pressed");
else
console.log("B pressed");
});
If this helped you, I'd appreciate it if you'd mark this as a Verified Answer, which may in turn help others as well.
Best Regards,
Nya