Hi @atrevido
It’s possible that your code is executed before ACF is loaded. Could you please try to add the code in acf/init
hook? This page should give you more idea about it: https://www.advancedcustomfields.com/resources/acfinit/.
Also, please make sure that the returned path and URL are correct. You can also check the developer tools on your browser for any error messages on the page.
I hope this helps 🙂