Why my wp_enqueue_script doesnt work on some page?

Hi add this code to your Function.php and jquery-ui.js should be loaded correctly on your website.

// Register Script
function custom_scripts() {

    wp_register_script( 'jquery-ui', '/assets/js/jquery-ui.js', false, false, true );
    wp_enqueue_script( 'jquery-ui' );

}
add_action( 'wp_enqueue_scripts', 'custom_scripts' );