Are these youtube videos you are trying to defer? It may be that it does not work with some video types.
Are you loading jQuery on the page in question? My JS depends on jQuery. I usually put the script in a “site.js” file that is enqueued for the site and set the depends argument array('jquery)` If you are not using jQuery then the script would need to be rewritten to use vanilla JS.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users