advanced custom fields – ACF Schema doesn’t appear on actual pages? Elementor

normally I install an advanced custom field on my pages registering this:

<?php if( get_field('schema_object') ): ?>
    <script type="application/ld+json"><?php the_field('schema_object'); ?></script>
    <?php endif; ?>

and it works fine.
I’ve installed that very function on the header.php file but the content of the custom field (a schema markup) isn’t appearing in my head section, how do I fix this?

I’m using Elementor.