Javascript asset not enqueuing with the rest

Your second wp_enqueue_script() contains the same handle (the same ID) as the first wp_enqueue_script().

The handle is the ID by which a registered script is known to WordPress internally. If you use this ID a second time, the second script won’t be registered.

A working example could be this one:

<?php
add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles_and_scripts' );
function theme_enqueue_styles_and_scripts() {
    wp_enqueue_style( 'fonts', get_stylesheet_directory_uri() . '/assets/fonts/icons/style.css');
    wp_enqueue_script( 'script', get_stylesheet_directory_uri() . '/assets/js/main.js');
   wp_enqueue_script( 'compiled-script', get_stylesheet_directory_uri() . '/assets/compiled.js');
}