I had this discussion with a AAA game studio recently. They have a hit game will millions of players and it's been a hit for many years. It uses a custom engine. They've been releasing new games. Those new games are in both Unity and Unreal.
You can see all the reasons
1. Their custom engine doesn't have all the features of either of those other engines. Their artists in particular are pushing to switch to get those features.
2. Their custom engine doesn't have have amount of tooling those other engines have (likely no blueprints, no shader graph, no state machine editor, no animation editor, etc..., etc..., etc...)
3. Their custom engine doesn't have tens of thousands of potential hires that already have experience with them.
4. Their custom engine doesn't have 1/1000th the amount of docs, tutorials, youtube videos, etc on how to use it so the team that maintains that engine has to provide that knowledge to every new hire
The result of the above is it limits their growth. If they want to start a new team for a new game, if they stuck with their custom engine they'd basically have to take a significant number of people off the existing game and move them to the new game otherwise no one on the new game would have any easy way to know how to use it.