I feel that it's not that Pep doesn't need his services, it's more like Kyle Walker wants a change now. It's natural when you have achieved everything for consecutive years, a player always wants a change. It was same with Gundogan and it's same with Kyle.
I see two players have different roles in Manchester City and they have different reasons to leave Manchester City. Gundogan had a more solid position and role in the club but it is not what Kyle got. He lost his position in their squad late of season. Suddenly he was used in two semi final matches against Real Madrid and contributed well to block dangerous attackings from Vinicius. Unfortunately, he was missing and not chosen in the final match. I believe Kyle felt that he is less important in Manchester City and decided to leave.
Pep always is happy with his squad but if a player wants to leave then he also doesn't tries to convince the player to stay at City.
Pep is smart and never stop trying new ideas, new tactics and players have to accept requests from Pep as well as be smart and adaptive enough. We saw how Joao Cancelo and Ruben Dias lost their positions in Manchester City.