Move scripts to footer, but exclude one script?

To stop enqueueing a script

We’re dequeueing the scripts completely (regardless from header or footer) with a higher priority (10+):

function dequeue_my_scripts() {
   wp_dequeue_script('script-handle-here');
}
add_action( 'wp_print_scripts', 'dequeue_my_scripts', 11 );

To put the script to footer

function enqueue_scripts_to_footer() {
   wp_enqueue_script('script-handle-here');
}
add_action( 'wp_footer', 'enqueue_scripts_to_footer' );

Right way doing this

But the right way enqueueing the scripts in footer is setting the last parameter, of wp_enqueue_script() or wp_register_script(), to true:

function my_custom_scripts() {
    wp_enqueue_script( 'script-name', get_template_directory_uri() .'/js/example.js', array(), '1.0.0', true ); //last parameter to true
}
add_action( 'wp_enqueue_scripts', 'my_custom_scripts' );

error code: 523