There are several risks you run with a character who mostly fails.
Your character may feel incompetent.
A protagonist usually needs to gain our sympathy and our respect. If the chain of failures is absolute, if they have no victories or notable accomplishments, that doesn't necessarily mean we don't love 'em. But, it does mean we don't love them for their heroism or their brilliance -- because they haven't managed to achieve any.
So, you probably want to spend serious effort making sure the protagonist is likable despite their failures -- or, find Moments of Awesomeness to give them, so we continue to see them as capable, worthwhile people, who are just up against something really really tough.
Your plotting may feel forced.
As an author, one of your jobs is to stack the deck against your protagonist; keep the conflict rolling; give them something epic to overcome.
But if you tip your hand too much, if you're too blatant about how the protagonist can't get a break, the reader can begin to find the story boring -- because all the tension has seeped out of it. If you know that the protagonist can't succeed at anything meaningful, then it's not a lot of fun to watch them try. If they always get there Just A Minute Too Late, then watching them race loses its edge. Sooner or later the reader is going to cotton on to the pattern, and then their reaction might just be a kind of,
The kind of pattern you describe -- of the protagonist failing again and again and again, and only being "allowed" to win at the very end, is... kind of an uninteresting one.
The moment the reader feels it's the author holding the protagonist back, rather than the actual plot and circumstances, the story loses a lot of the reader's investment.
This isn't a necessary consequence. Some stories manage to manage stakes masterfully; always offering a light at the end of the tunnel, even if the readers' hopes are consistently dashed. In others, the constant failure is the point, and the reader feels that the failures are, themselves meaningful.
Another way to deal with this is to allow personal victories, partial victories, or temporary victories. Enough for the story not to be predictable and monotonous; enough to feel that things are dynamic and important things are happening in the middle of the story, too.
(George R.R. Martin, in A Song of Ice and Fire, might be said to be relevant here, on all these counts. But do bear in mind, after basing a whole series on dashed hopes, he seems to be having a lot of trouble bringing the series to an actual close...)
Your book may feel hopeless.
It's possible that your protagonist's constant loses just make the book feel... hopeless. If it makes sense within the world for the protagonist to lose again and again, you might wind up giving the sense that the entire struggle is pointless, lost before they even started. The reader might get the sense that the hero can't win, and have trouble getting excited about yet-another desperate shot.
This is a very particular problem (and, in some books, a feature rather than a bug). You probably won't do this by accident, but it's worth keeping an eye out for, and reminding yourself of what the reader is hoping for, invested in.
A great example of this, both in strength and in weakness, is A Series of Unfortunate Events. In this series, a sense of despair and futility are very much at the core of the books. Even so, the first books fall into a very repetitive cycle, where the children are thrust into a horrible situation, and only barely escape it, while the villain remains at large -- which makes for a discouraging read, simply because it grows to feel formulaic. But around Book 5, the series sets off in a new direction, with a larger plot and moving further and further from the simple initial formula. The series remains morbid, and the characters do fail continuously,but you want to read on and see how.
This is all heavily dependent on execution.
These are considerations, not well-quantified rules. Advice can give you things to think about, but you're not doing anything wrong, and certainly not anything irreversible. So, don't let this block you too much when you've only just planned out your book. Write, because it's only from a finished draft (and, later, reader feedback) that you'll be able to tell if the failure is "too much," or just awesome and exciting. Keep the risks in mind, be ready for the possibility of needing to add some Moments of Awesome in when you revise, and you'll be fine.
All the best!