If you're interested in exploring these ideas further, I recommend Nathan Abram's Kubrick book: https://www.amazon.com/Stanley-Kubrick-York-Jewish-Intellectual/dp/0813587107 (which I haven't read yet, but which may explain things more clearly than I have).
Here's a description of a talk he gave: "Professor Nathan Abrams in conversation, focusing on the central functions of Jewishness and psychoanalysis that shaped Kubrick’s auteurial preoccupations relating to themes such as war, outer space, masculinity, madness, and the mysteries of marital eroticism." [Emphasis added.]
I also highly recommend "The Age of Insight: The Quest to Understand the Unconscious in Art, Mind, and Brain, from Vienna 1900 to the Present" by Eric Kandel, which I have read. Even if you disagree with Kandel, I suspect you'll find the book stimulating.
Kandel is interesting, because he's one of our leading neuroscientists, and yet he doesn't simply reject Freud as pseudoscientific nonsense. Of course, he does reject Freud's specific "scientific" claims but not all of his philosophical ones. Reject them or not, they were highly influential on 20th Century art.
The book doesn't mention Kubrick, but Schnitzler figures into it. It's a book about some of the people who most influenced Kubrick and the common threads that ran through their work.