Unfortunately, I’m not sure what’s causing the issue. This isn’t necessarily a “Theme Issue”, but looks like it may have to do with the code/file itself.
I’d suggest using a different method if that doesn’t work, as I’m sure there are other solutions out there.
If I come across anything that might work I’ll definitely let you know as soon as I see it.