For all the “fail fast” thinking, this does not feel good. How do you deal with such a situation?
2. Keep a daily log then summarize it weekly. Summarize weekly logs monthly and quarterly. After success or failure go back over your logs before having a retrospective and see if you can identify choices or behaviors that pushed the outcome.
3. Was the failure within your control? If so how can you stop it next time? If not how can you avoid a situation where you are on the hook for a project without the autonomy to make it right?
4. Change the place you work, or change the place you work. If you don't have the autonomy for success find a place that compensates you and you have fewer responsibilities or are empowered to succeeded.
Don't sweat it we all screw up.
I'm a lead for a data science team and I feel like we have to deal with failure more than an average development team. Most of the causes are out of our hands, so there is no sense in dwelling on them except keeping past experiences in mind when planning the next project.
In your message you said unsolved usability issues. Typically usability issues should be solvable. My advice is accept the failure, learn from your mistakes for the next project. These things happen. Just move on.
Also 4 months is too short of a time to declare it as a failure. You can always pivot to make it successful
I would write a document stating exactly what went wrong, based on that suggest measures and changes to prevent this from happening again in the future. Be brutally honest, but refrain from playing the blame game, do include your own mistakes, be as objective and fair as possible.
You could also see if you can salvage your project in anyway and suggest how to move forward. Usability issues can be solved, technical choices can be changed.
For either option there should be broad support. If not it might give you more insight in the "politicking" that's going on.
Also realize that people make mistakes, nobody is perfect. The best you can do is learn and move on. Beating yourself up over it won't help you in any way. Don't be mean to yourself, be honest but in a kind and empathic manner.
Anyway, it sucks, especially with politics involved, hope you can move on from it. Good luck!
With the experience you and your team has gained you can probaby get back to where you are currently stalled pretty quickly and deliver a great solution.
The better part of success is knowing correctly what you have to do, so now that you know having learned the hard way just do it. Having to admit you were wrong and wasted resources sucks, but it's better than doubling down on something you know isn't going to work, especially if it's important to the business in the long term.
You have a good track record, so do not feel bad about one failure. No-one succeeds every time, and the occasional failure is necessary to ensure we learn how to deal with adversity and become more resilient.
No need to feel bad, even if you don't make the same mistake twice, you'll make a different mistake next time!