Hear me out. In the most basic sense, to believe the mind a box that can output things not based on input is inherently to believe it "irrational" in the truest sense of the word.
It is to believe the mind to be non-functionally pure[1] in the programmatic sense. Output based somehow other than purely on input.
And if that's the case, the question is where does that irrationality come from? A random number generator? Any developer knows there's no such thing as actual random. It's all either list based or based environmental aspects.
I don't see room for an argument to be made that the human mind isn't just mixing ideas/the environment that doesn't rely on some form of magical thinking.
1. https://en.wikipedia.org/wiki/Pure_function