As a beginner I often thought about a problem for days before finding a solution, but this happened less and less as I improved
I got better at exploiting the things I knew, to the point where I could be pretty confident that if I couldn't solve a problem in a few hours it was because I was missing some important piece of theory
I think spending days "sitting with" a problem just points at your own weakness in solving some class of problems.
If you are making no articulable progress whatsoever, there is a pathology in your process.
Even when working on my thesis, where I would often "get stuck" because the problem was far beyond what I could solve in one sitting, I was still making progress in some direction every time.