Real Madrid has the budget but they ran out of their main options, Mbappe mainly and Haaland also.
You are right. Real Madrid already failed to sign their main targets, Mbappe & Haaland. Man City signed Haaland because Haaland's father ever played as a Man City player, City got an advantage of his father's history. While Mbappe decided to stay because Mbappe wants to play more in France and was interested in the big money offered by PSG management. Honestly, Real Madrid is very unlucky, they failed because of personal reasons that influenced those players' decisions. The latest news, Real Madrid wants to sign Lewandowski from Bayern. This may be the final target and probably fails also because Bayern doesn't want to lose their main striker. Too bad transfer season for Real madrid...
If you look at the total cost, then I doubt that buying Mbappe would be profitable - it is unlikely that he will pay back the money invested in him. Haaland is much closer to that but it remains to be seen how he fares in terms of injuries - this season he has had a lot of missed games due to various injuries. If this continues then such instability will be a big problem for the club. In general, I think Real Madrid will find good alternatives. A whole summer ahead.