You can definitely subvert expectations like this and still create a great story. However, there's other issues with this story structure that should be kept in mind.
My protagonist is a skilled character whose powerful traits allow him
to succeed continuously throughout the story. He is challenged by foes
along the way, but he eventually overcomes them all.
I'd like to suggest that you might need to rethink your story just a little bit to avoid "concept-imprisonment", in which having a clear concept around which your writing twirls ultimately imprisons you as a writer, limits what you can do, and finally results in the creation of a one-dimensional "concept piece" that isn't as rich or enjoyable as you had originally hoped.
The danger here is really that the reader gets a sense of your protagonist's skill and ability too early on in the piece. You could easily end up with a story where there's really no tension, no adversity and no character development. This would be pretty boring, but in light of what you've described it's a real risk.
To keep yourself free enough to avoid falling into these traps, I recommend creating some get-out-of-jail free cards for yourself so that anytime you want to take the story in direction A but your grand concept plan suggests direction B, it remains possible to take direction A by playing one of these get-out-of-jail-free cards.
For example, in Thor Ragnarok, the almighty Thor has a chip in his neck for most of the movie that allows people carry the appropriate remote to cause him to become paralyzed and lose any fight he's about to win. This creates a lot of tension and uncertainty, and allows the writers to have him lose fights where the narrative demands it, resulting in more freedom for them and ultimately a better story. You could have something similar.
I also think that your story should be a trilogy. In the first book, you subvert expectations with the hero's unexpected loss. In the second and third books, he/she has to live with the consequences of this loss, learn some difficult lessons, and ultimately maybe they will triumph. In this way, you can subvert expectations while still crafting a story that leaves people feeling like a satisfying conclusion was reached.
Also, I think you should keep in mind that subverting expectations, while nice, only makes your story slightly better. Indeed, when the subverted expectations don't feel satisfying and don't play a role in a larger, more interesting narrative, they can feel pretty empty. With this in mind, I'd like to express disagreement with one of the comments made by another answerer.
This is subverting a trope. The trope is an expected cliché: "the hero
always wins", but then you break or subvert expectations. (See 2016
for middle-aged men having a cosmic meltdown because their Star Wars
expectations were subverted.) - wetcircuit
In my opinion, what let TLJ (The Last Jedi) down was not subverted expectations; indeed, this was one of the few strengths of the movie. What let TLJ down (aside from the annoying gender politics that burdened it down in so many ways) was that all the writer's creative energy was invested in subverting expectations, leaving not a lot of creative energy for other very important things. In particular (spoilers ahead):
There was a lack of attention to characterization and character development. Luke acted totally out of character the whole movie and the tiny amount of explanation we were given for his intense apathy and cynicism wasn't enough to make it feel like the same character. Yoda acted totally out of character and came off more like a book-burning nutjob than a wise elder. Rey's character was okay, but did not really develop in a meaningful way, and her power levels were way too high for no reason. Fin's character retrograded to make it seem like the last half hour of Force Awakens never happened, e.g. when he's trying to escape near the start of the movie. Poe's character was cool as always, but he already seemed fully developed before the movie began and the feeble attempts at creating human-growth opportunities felt forced... you know, I have this image of some really stern unpleasant woman trying to explain to Mohammad Ali that he's doing this whole life thing wrong, just several days before his monumental victory. This doesn't seem like an opportunity for growth. It just seems lame, and the audience naturally stops paying attention because it's just too stupid.
There was also a lack of attention to the canon. For example, Leia uses the force to levitate her way out of empty space and back into the safety of the ship. If the force can do this, why didn't Palpatine use this to save his arse at the end of Episode 6? As another example, Holdo weaponizes hyperdrive to devastating effect in TLJ, which was visually cool. But it does make you think about that A-wing that slammed into the executioner in Episode 6 - shouldn't that pilot have jumped to light-speed to increase the damage? Indeed, if hyperspeed is such a devastating weapon, wouldn't they have built missiles based on the technology long ago? Etc. etc.
It seems to me that most of the above problems probably arose because the director was so focused on surprising the audience that many other important story elements ended up taking a back seat.
So the lesson here is really, yes, do surprise your readers if you can, but only if it makes retrospective sense and fits into a bigger and grander story. Don't expect that just doing something unexpected will instantly make your story good. Interesting characters with relatable goals, sympathetic viewpoints, and the kinds of character flaws that real people have will do more for your story than cheaply subverting the reader's expectations all the time, and you need to keep in mind the different elements that go into a good story to get the balance right.
Above all, I just want to emphasize: don't write yourself into a corner where a single concept ends up reducing your story to a mere idea, or mere philosophy. The weakness of writing is that it's not empirical, it doesn't take into account statistics. You read one story at a time, and who knows how likely that story really is? But the strength is that you can explore details of existence, and really get involved in the messiness of life in a way that science cannot. And, you should play to this strength, because assuming you're writing for adults, exploring the messiness of life is going to be a key element of just about any great story.