Use of CONSTANT in wp_enqueue_script not possible?

Parent theme’s functions.php is loaded after that of child theme. So your constants are not available at the moment of child theme loading.

It is good practice to actually run any theme code at the hook after both themes are loaded. At the earliest at after_setup_theme hook. For enqueues is is explicitly documented that init hook should be used.

error code: 523