And similarly, whilst one proof might have limited practical applications, it's very difficult to know which proofs do have practical applications and it's almost impossible to know which results might later yeild further proofs that do have practical applications.
None of this is really a matter of intelligence, it's a matter of putting in work (although obviously there is intelligence involved to find particularly neat ways of appraoching problems).
And why do mathematicians learn proofs? Often, to see the approaches that you can use to solve other problems.
I do think something related to this is less obvious than you're suggesting. A proof generally presents a train of thought gets you from point A to point B. It's almost never a representation of the train of thought that the author actually followed to get from point A to point B. This is obvious to people with experience in mathematics, but it's much less obvious before you have that experience. Even if you know it's true in principle, appreciating it viscerally and adapting the way you interact with mathematics to account for it is basically a lifelong task.
A big component of good mathematical communication is explaining what motivates a solution to a problem (or even what motivates the problems in the first place). Sure, you don't have to do that every time, but it's fair criticize a broad lack of this. A lot of mathematical communication is... not good in this sense. Notably, the problem/solution in the OP isn't really motivated by the author. A skilled reader will think about it themselves, but they need to learn that skill somewhere.
More or less on topic, here's an example where an experienced mathematician tries to reproduce one of Sylow's theorems without looking it up, and writes down a more-honest account of the thought process involved: https://gowers.wordpress.com/2011/12/10/group-actions-iv-int...
https://www.youtube.com/watch?v=OkmNXy7er84
"And those of you who follow the channel know that rather than just jumping straight to the solution, which in this case will be surprisingly short, when possible I prefer to take the time to walk through how you might stumble upon the solution yourself. That is, make the video more about the problem-solving process than the particular problem used to exemplify it."
I bailed out of math around calculus, and these videos helped me at least appreciate what I was missing.
For one thing, in my experience, working on real life problems involves a whole lot more "memorizing problems" than working on mathematics.
And thank goodness for that! When I drive over a bridge or install an app, I really don't want to hear that whoever made it has an aversion to memorizing problems and solutions. Solving a real world problem is usually boring. Making a real life thing well is usually about correctly putting together many pieces that some other people have put together, in a way that's roughly similar to how somebody else has already put a lot of those pieces together before. Most of the work is well-trodden and uncreative.
I think part of the reason mathematics feels like it's about "memorizing problems" is that getting something deeper than that out of it is a habit/skill. A very important aspect of the vague notion of "mathematical maturity" is a habit of looking at a solution to a problem with the mindset of "how could I have come up with this?". That is, unpacking a problem and solution into some deeper understanding or way of thinking that led to it. As opposed to filing the problem and solution away "as is" into some toolbox to be referenced later. A lot of "gotcha!" solutions to mathematical problems are unsatisfying precisely for this reason.
In a lot of cases once you've read a problem and read a solution to that problem, and understood the solution, you've done about 10% of the work. The remaining 90% is this difficult work of unpacking and repacking lessons from that solution into something that actually deepens your understanding of what the problem is about. Sometimes reading the solution is actually doing negative work.
In other words, if you look at this problem and look at this solution and think "neat, but I don't get anything out of it beyond 'neat'", that's normal and fine, and probably correct. But that doesn't mean there isn't anything in it beyond 'neat', and a big part of learning mathematics well is to dig deeper than that even when the problem and solution don't force you to. Whether that digging is worth it is up to you. (It's often kind of a crapshoot in terms of payoff.)
But that's a more complicated situation than "this shows a fundamental flaw in mathematics".