is_page not working when loading javascript with add_action in functions.php

I had a similar issue once. I found that running the add_action call outside the conditional worked. So try this:

    function js_custom() {
        if ( is_page(273) ) {
            wp_register_script( 'js_custom', get_template_directory_uri() . '/js/custom.js', false, null);
            wp_enqueue_script( 'js_custom' );
        }
}
add_action('wp_enqueue_scripts', 'js_custom', 50);

error code: 523