Can’t deregister / dequeue scripts in WordPress

You are dequeuing before the script may even be enqueued. Test with a hook that is actioned after wp_enqueue_scripts to deque.

https://developer.wordpress.org/reference/functions/wp_dequeue_script/

/**
 * Dequeue the jQuery UI script.
 *
 * Hooked to the wp_print_scripts action, with a late priority (100),
 * so that it is after the script was enqueued.
 */
function wpdocs_dequeue_script() {
    wp_dequeue_script( 'jquery-ui-core' );
}
add_action( 'wp_print_scripts', 'wpdocs_dequeue_script', 100 );