I also have the same problem. The website (with a custom theme) has a gallery on the homepage, which works, and it has one on a page, which doesn’t work and gives the same errors as described above. When I remove the gallery on the homepage, the one on the page starts working again. While I have Yoast plugins installed, none of them are activated.