As far as I know the deal is pretty safe between Ancelotti and Brazil although I don't know whether there have been any signings yet.
I assume that if Real Madrid can't find an alternative, maybe there will be compromise for one more season with Ancelotti. But he knows if he wants to prepare the Brazilian team for 2026, he can't wait any longer than until summer 2025. I am sure that coaching a national team at a World Cup is one of his big plans and getting the chance to take responsibility for the Brazilian team sounds like a great opportunity. But if he doesn't give it enough, time it might go wrong big time.
There seems to be no signing yet because considering that Ancelotti himself is coach who still has contract with Real Madrid, perhaps after his contract expires there will be an inauguration or signing of an agreement from both parties.
There is the name Xabi Alonso who is always associated with Real Madrid to be able to replace Ancelotti and of course Ancelotti has also agreed or stated that Xabi Alonso will be good coach for Real Madrid.
All this is because of Xabi Alonso achievements in bringing Leverkusen to improve the quality of the game and consistently succeeding in bringing Leverkusen so far to the top of the standings and has the opportunity to become Bundesliga champions.
I also think that Real Madrid doesn't need to look for an alternative who can replace Ancelotti for a longer time because there are also several reports circulating that Xabi Alonso is also interested in being able to train the Real Madrid squad and lead them to title UCL again.