Api rest endpoint does not work when is called from jquery

Something very strange is happening to me that I can’t find an explanation for. Developed a rest api with nodejs that makes use of mongodb, which works fine when I test it with postman. One of the endpoints performs a database insert, and as I said, it works correctly from postman. I have developed a client application for that rest api that consumes the different endpoints through ajax calls with jquery. The problem I have is that the call to the endpoint to insert does not work. No errors are displayed, but the data insertion is not performed. The strange thing is that when you run the code step by step through the chrome debugger, it works. The code is the same, I don’t understand how if it inserts when it is executed step by step. The rest of the calls to the other endpoints of the rest api work correctly.

I upload here the jquery code that makes the call. This code is executed when a button is clicked:

function nuevaIncidencia(){
let titulo = $("#titulo").val();
let usuario = $("#usuario").val();
let descripcion = $("#descripcion").val();
let severidad = $('#severidad option:selected').val();
if (titulo!="" && usuario!="" && descripcion!=""){
    
    $.ajax({
        type: "POST",
        dataType: "json",
        contentType: "application/json",
        data: JSON.stringify({
            "title":titulo,
            "description":descripcion,
            "user": usuario,
            "severity": severidad
        }),
        url: "http://localhost:3600/api/createIncident",
        
        success: function(data){
            location.href="index.html";
        }
    });
}

}

I would greatly appreciate a little help. Thanks in advance.