This problem started when I noticed at some point that the global JS code stopped reflecting changes, which was verified via console logging. Then, I noticed that the arrow that expands or retracts the JS field in theme options was not responding, so I reloaded the whole page, and that’s when the JS field appeared empty all of a sudden. All of my code was gone from it, yet all of it works and seems to have stuck in the page source since then.
Edit: Just to pinpoint another possible source of the problem, the global JS was once accidentally copied from my JS editor and saved directly into the homepage rather than the global JS in theme options. However, both are blank now and the problem still occurs. I tried disabling all plugins and reverting to the original Pro theme then back to the child theme (which I created using your instructions in the documentation) to no avail.
The duplicated scripts are the very last thing in the
<body> tag, inside this element: