My page crashes on Instagram in-app browser

We recently noticed our page was not loading on the Instagram in-app browser and instead it shows a blank screen. I’ve tried mocking that browser, adding a custom device on Chrome Dev Tools using the instagram browser’s user agent.
While debugging I noticed the page is injecting a Cloudflare script:

    ...
    </head>
    <script>
        (function() {
            var js = "window['__CF$cv$params']={r:'7fb45c513a97952a',t:'MTY5MjgwNDI0Ny43OTUwMDA='};_cpo=document.createElement('script');_cpo.nonce='',_cpo.src='/cdn-cgi/challenge-platform/scripts/invisible.js',document.getElementsByTagName('head')[0].appendChild(_cpo);";
            var _0xh = document.createElement('iframe');
            _0xh.height = 1;
            _0xh.width = 1;
            _0xh.style.position = 'absolute';
            _0xh.style.top = 0;
            _0xh.style.left = 0;
            _0xh.style.border = 'none';
            _0xh.style.visibility = 'hidden';
            document.body.appendChild(_0xh);
            function handler() {
                var _0xi = _0xh.contentDocument || _0xh.contentWindow.document;
                if (_0xi) {
                    var _0xj = _0xi.createElement('script');
                    _0xj.innerHTML = js;
                    _0xi.getElementsByTagName('head')[0].appendChild(_0xj);
                }
            }
            if (document.readyState !== 'loading') {
                handler();
            } else if (window.addEventListener) {
                document.addEventListener('DOMContentLoaded', handler);
            } else {
                var prev = document.onreadystatechange || function() {}
                ;
                document.onreadystatechange = function(e) {
                    prev(e);
                    if (document.readyState !== 'loading') {
                        document.onreadystatechange = prev;
                        handler();
                    }
                }
                ;
            }
        }
        )();
    </script>
    <script defer src="https://static.cloudflareinsights.com/beacon.min.js/v8b253dfea2ab4077af8c6f58422dfbfd1689876627854" integrity="sha512-bjgnUKX4azu3dLTVtie9u6TKqgx29RBwfj3QXYt5EKfWM/9hPSAI/4qcV5NACjwAo8UtTeWefx6Zq5PHcMm7Tg==" data-cf-beacon='{"rayId":"7fb45c513a97952a","token":"1a2dd5ac6a9c420e977d0e2858d6cccb","version":"2023.8.0","si":100}' crossorigin="anonymous"></script>
</html>

but the script is failing because there isn’t a tag.
So, my question is why would it render like this only on this browser, does Cloudflare add an special cache or rules layer for the Instagram browser that could be provoking this issue.

Please disregard. We had a lambda function in CloudFront affecting how the page was being rendered in some user agents.