AAA companies don't want to spend money on developing internal engines anymore because they can save upfront cost using Unity/Unreal instead. It's a shame because there are a lot of internally developed engines that have great optimization. Case in point: the Fox Engine used for MGS V. That game released in a buttery smooth state. Budget rigs could run that game at a high framerate without stutters, and it still looked incredible.
At this point in AAA game development I imagine a lot of devs don't even know how to program fluently, and can get by just tinkering with their basic knowledge in the third party engines. Gun to head I doubt most of these companies would be able to assemble a team to develop an engine with immediate talent. They would probably have to hire a brand new group for that sole purpose. The people that can develop engines aren't working at game companies, there isn't money in it for them.
The reason why AAA companies aren't developing their own engines anymore is because:
1. You need experienced, well-paid software engineers to do that. They used to work in game dev, because they were nerds and mostly had creative freedom, so they stomached the crunch and shit pay to pursue their dreams. Now there's no creative freedom, a lot of programmers don't even know how to assemble a PC (I have Master's in Comp Sci and know this first-hand, there were people who were absolutely better programmers than me, but were clueless about PCs) and the pay is still shit, and the crunch is still there. No reason for competent programmers to be in game dev anymore.
2. Every time you brought someone new, you had to teach them about the internal tools. I imagine there were numerous times when someone left due to shit pay/environment before they even did any work - lost time and money for the dev and publisher. Compare that to Unreal/Unity, which are publicly available and a lot of schools teach at least the basics on how to use them. Easy to get cheap fresh grads to grind until they have enough and then replace with new ones.
3. Developing an engine is only one part, maintaining it, updating it and documenting it is a never ending, constant cost, while Epic/Unity does all that for you.
The onboarding is the biggest advantage, I believe. With the ever insufficient deadlines and ballooning budgets, it seems like a good thing for the dev and publisher that they can easily replace anyone with cheap labor at a moment's notice, and they can get to work immediately, quality notwithstanding. Sweatshop mentality basically.
An additional reason why games run worse now is DX12 and Vulkan adoption. The reason they were introduced was the devs wanted more control over low-level stuff. Turns out, however, that most of the devs are too incompetent to handle low-level stuff. DX11 and earlier and OpenGL were more obfuscated, but that in turn allowed Nvidia and AMD to optimize to a greater extent with drivers, and they have much better engineers than any AAA dev. Now it's almost all on the dev side, and we're seeing the effects of this.