Ricciardo knew he would never have a chance of being champion alongside Verstappen, so he left the team for Renault in 2019 where he stayed for two years before switching to McLaren in 2021. While at Renault he had difficulties at first, but he managed to get by. recover, the same did not happen at McLaren. Not getting along with the car, Ricciardo had his last year of contract canceled and ended up getting worse.
I think that's why he preferred to go back to the house where he feels more confident and try to build his career there again.
I understand Perez cannot be with Max for another 10 years, which means they need to hire someone younger. Daniel is not that person, he has that "hope" and I get that, and they wanted a reserve driver that would be good too, and that’s why they hired him, but it’s just not that easy of a situation. It cannot be just Perez leaves and Dany starts racing, that would only be good for like 1-2 seasons at best.