I Figured out the issue causing the problem in my case.
The block of code that contained acf_formhead() was being included using locate_template().
I changed the the way I included that block to use a regular include() instead and my problem was fixed.