As obvious as it is to say that everyone is fallible, many leaders and managers I have known over the years seemed to think that their subordinates expected them to be always right, and perfect. Most humans are much too smart to expect perfection from their supervisors. What they want to see out of their supervisors is a solid effort to deliver value, a strong effort to be fair, and a willingness to admit when they are wrong, made a mistake or misbehaved. It is amazing what simply saying you are sorry and will try to do better next time does.
When there is a significant failure, the organization needs its leaders to be at their best and the people in the organization need to know that they are getting the truth. The first step is to get the entire team or organization together and acknowledge the failure, discuss the implications for the organization and your plans to weather the difficulties. I have had to deal with many disappointments and failures in my career, as is common in the drug discovery and development industry, and some were organizationally existential. Though the truth was often painful to tell, and the company hung in the balance more frequently than I care to think about, I told the truth and laid out a plan to move forward including the risks and the odds of success. I felt that I had asked people to invest in my dreams and always owed them the truth. Because I did that consistently through good days and bad, I earned trust and commitment and never lost a single person I needed to keep if we were to be successful.