Output a WooCommerce product custom field in WooCommerce using get_post_meta()

There are some errors as get_post_meta() first argument need to be a defined product ID here (and in your code post_ID is not even dynamic variable and will not give anything)…

Try the following:

<?php
     function check_gtin(){
         if ( $gtin = get_post_meta(get_the_id(), 'gtin', true) ){
             echo "gtin13:". $gtin;
         } else {
             echo 'identifier_exits:false';
         }
     }
 ?>

Then:

<script type="application/json+ld">{"<?php check_gtin(); ?>"</script>

It should better work…