I am using wordpress 5.0.3. I put this code functions.php but it’s having same issue.
I tried to dynamic footer section, after then I am facing this problem.
But it’s working for the other pages, where I also used acf. Only the home page showing this error.