Javascript not getting injected into page

I have been pulling my hair out for the past couple days trying to fix an issue that I simply can’t seem to get around.

I’ve provided a file containing 4 files. The steps below will create an environment similar to mine, to replicate the problem.

https://gofile.io/d/Q4Uaiz

We now have the same environment.

If you click on an article in the sidebar, you’ll see the right pane update with the article you clicked on. A read more button also appears.

If you click on read more, it will take you to a new page. On this page, you will see graphs displayed.

This is the problem: for some reason, I cannot display on the graphs on the preview pane (the one with the “Read More” button).
I have tried everything, but the Javascript is simply not being injected into the preview pane page, whereas it is in the single post page, and yet they both get their content from the same file, “content-single.php”.

I would massively appreciate any help, as this is driving me crazy. Thanks a lot