Real Madrid could always find a replacement for Casemiro. The guy is very old and not much more chance for him in Real Madrid in the next few years. I saw some unconfirmed news about Real Madrid wanting to find a Casemiro replacement, one of the candidates is Tottenham's midfielder, Pierre-Emile Højbjerg. This comes from a tier-2 news runner from England so not very sure but does carry some merit.
It was precisely because they had found a replacement for Casemiro that Real Madrid decided to sell him.
Casemiro feels marginalized after Real Madrid signed Aurelien Tchouameni from AS Monaco earlier this season. Casemiro decision to move to Manchester United because his position as a main player began to be threatened, especially when it was rumored that coach Carlo Ancelotti promised a place in the main squad for Aurelien Tchouameni.
Real Madrid are not unwilling to keep Casemiro in their squad, but they already have an ideal replacement for Casemiro. Tchouameni was recruited by Real Madrid to replace Casemiro, he is only 22 years old and in the same position as Casemiro, for that reason Real Madrid did not need to think long about accepting an offer from Manchester United.
Currently, Real Madrid already has Tchouameni who can be played regularly if Casemiro really went to Man United. But there are rumors that Toni Kroos wants to end his career when his contract expires. So if the rumors come true then it's clear that Real Madrid will need a new midfielder. Well, maybe it would be best to prepare now or at least Real Madrid has signed a new midfielder before the season ends, which means it could be done in the upcoming winter transfer window.