I have solved the issue. I think I have identified what was creating the CSP error.
As I have understood, what was triggering the error was setting the event listener onclick to an HTML element in the way that is shown in the screenshot with Javascript.