All of these problems occurred purely out of Ancelotti's expectations. Initially this coach really believed everything was fine in all squad positions. And after that Ancelotti wanted to make changes and strengthen the attack line to recruit Mbappe. But unfortunately the problems came in a row and made Madrid fail to win titles in any competition. In this case there is no need to blame and we must leave the bad past and now Madrid has Xabi Alonso who will provide a positive change. Rest assured that Madrid will be even better in the new season.
I wouldn't put the blame on Ancelotti or the players, because the team lacked the quality of a good defense and midfield due to injury on their players which started in the beginning of the season. Ancelotti has done his best for the club and he has to leave, let someone else take over. If a coach continues winning trophies, no club would replace him.
Nobody expected so many defenders to be injured, and Ancelotti certainly doesn't want to be in that situation. But strangely, when it happened, and he had the chance to fix things (when the January transfer window opens), he did not take advantage of the opportunity, and it was as if he underestimated the problems they were facing. So for that reason, Ancelotti is indeed to blame for their failure.
I think that's the reason why he stepped down, because he felt he had made a mistake that made Madrid fail to win a trophy.