Kompany helped Bayern Munich get improve however he is not the first choice for this team and they were about to hire some other coaches instead of Kompany. As far as I saw in the news the management of Bayern Munich asked Pep Guardiola and he advised them to hire Kompany and you saw so far Pep was not wrong about this coach in Bayern Munich but still even his good performance doesn't mean he can win the title on Bundesliga with Bayern Munich but still Leverkusen is very close to them and if Kompany and his player make any mistake, Xabi Alonso is there to take their place.
Pep Guardiola did not succeed in his first time of management in Bayern Munich, no Champions League title after some seasons in Munich. It's reason he left Bayern Munich and moved to Manchester City. Now he has one of worst time not only in Manchester City but also in his coach career so far. Perhaps leaving Manchester City and reuniting Bayern Munich, can be an acceptable exit gate for him.
When Kompany was handed the charge at Bayern Munich, the management should have thought whether this manager would be able to carry out the duties of Bayern Munich properly. If he is given the responsibility now in the middle of the season, if he is removed and someone else is given the responsibility of the club, it will certainly be a blow to the reputation of this manager. The managers who have been in charge of Bayern Munich before, especially the manager who took charge of Bayern Munich last season, have not been as successful as Kompany, but since Kompany took charge of Bayern Munich, their performance has at least improved somewhat in the local league. I think Bayern Munich should let him play for the whole season. If Bayern Munich do not perform well under him for a full season, the management can remove him from the job and appoint another experienced manager to their club.
Kompany is a young coach and he needs time to improve his management, but Bayern Munich actually saw good potentiality of Kompany by signing a contract with him. As a biggest and most successful club in Germany, they don't want to win only Bundesliga but also Champions League. So far they are playing good enough in Bundesliga and are leading the domestic league. With 4 points more than Bayer Leverkusen, Bayern Munich have good point difference but it is not too big and too safe for them.
I believe Bayern Munich will keep Kompany if he can win Bundesliga title in this season no matter how they perform in Champions League. Bayern Munich can wait for better performances in Champions League with this young coach.