Every team has its glory days and like Bayern Munich is currently in decline because of the mistakes it made in the past, and what you said is true that the first mistake made by Bayern Munich management was when they fired Nagelsmann.
A tough task awaits Kompany because the Bundesliga is currently very competitive with the rise of several teams, especially Leverkusen, which is making it increasingly difficult for Bayern Muncih to dominate the Bundesliga like it did in the past.
To be honest, I have a little doubt about Kompany because he doesn't have experience, especially now that Bayern is in a slump, of course it will be a little difficult to get this team back up.
This season has not been the best for Bayern Munich, they have struggled to win some of their games, despite signing a top striker who believes he can win a trophy with the Bundesliga team. I believe the Bayern management will regret their decision to fire Nagelsman and replace him with Tuchel, expecting that he will continue to perform at Nagelsman level. When Tuchel joined Bayern Munich, the team was already at the top of the league, and if Dortmund had not failed to win their last game in the two previous seasons, Tuchel would not have won a trophy with them.
Kompany will have a difficult task building the team for next season because Leverkusen has already broken their long standing record of winning the title. It is possible to maintain the club next season since Xabi Alonso, who has been successful with Leverkusen this season, has never managed a big team in his coaching career, Xabi Alonso had only coached Real Sociedad B before being selected as Bayer Leverkusen manager and we have seen the progress he brought to the club, including winning a trophy in his first season. So Company's failure to manage his former club doesn't stop him from managing Bayern Munich next season. Let's see what happens next season.