Changing hash throw: Uncaught Error: Syntax error, unrecognized expression
Thanks to @Alfred Armstrong pointing down form.js. It seems this event is responsible of that behaviour:  

 $(window).on('hashchange.form-fragment', debouncedHandleFragmentLinkClickOrHashChange);


It looks like unbinding it in my custom .js does the trick. We won't benefit from the scroll functionality form.js provides, but we could recreate it with:

$(window).off('hashchange.form-fragment').on('hashchange', function() {
    //something that scroll 
});