An old post of your’s (Tom’s) mention putting the script in the footer. Then I also see where it is suggested to put the script into wp_head by using a hook. Id i that and then ran the Google Structured Data Testing tool (https://search.google.com/structured-data/testing-tool) and while I received no errors, the ony “elements” I see are the ones coming from Generate Press itslef. Here is the code I used in the wp_head using a hook
Just an FYI – You can put the JSON-LD file anywhere – header footer. Since it is in-line in your HTML should be no issue with the speed of the page load.
In the testing tool, you can test a complete page or the code. I’d test the JSON-LD code first to make sure it is correct. Once that is working and you get what you want, then attached it via the header or footer hook and see if it shows up correctly