Staying back at Real Madrid when he’ll not be used by the manager is not the best idea for his career. If he does that, his performance will continue to drop and he’ll even end up not getting what he needs from his former manager in the Brazil national team. If he can play up to the standard to take a spot in the Brazilian team, no matter the relationship he has with Ancelotti won’t make him get to play there as he wants. He needs to remain fit, active and show worthiness of the task given to him to represent the national team and he can only achieve that if he’s actively getting to play in Real Madrid as usual.
I think it is better to shake up the field in a lower-class club than to warm the bench in a higher-class club. A player's identity is based on playing, if a player does not get the chance to play in a certain club, there is no point in humiliating and weakening himself by staying in that club. Rodrygo is a young talented player, his career is still ahead of him. In general, it is very important for him to perform on the field. But at Real Madrid, this opportunity may not be regular for him. If the manager does not use him regularly, then returning to that club as a substitute could be devastating for his career.