If you're working in a development environment where management is drawing hard lines at choosing your tooling you should find a place that's going to succeed.
That's right and you have a choice to accept that job. If the tooling takes you by surprise you either didn't do your due diligence with a new employer or you were lied to.
For a lot of studios, even very large ones, that's not the case anymore, and even those that have their own engines don't use them for everything. Nintendo has several engines, but Pokémon Go is made in Unity, as was Mario Kart Tour and Pokémon Brilliant Diamond and Pokémon Shining Pearl. miHoYo has over 5000 employees but they still use Unity for Genshin Impact and some of their other games. Blizzard surely had the money to make their own engine for Hearthstone, but they chose Unity.
This is even more pronounced for Unreal, where Final Fantasy VII Remake, Valorant, Apex Legends Mobile, Star Wars Jedi Fallen Order and Survivor, Octopath Traveler, and tons of other wildly profitable games are made in it. CD Projekt Red is making the next Witcher game in Unreal as well. Square Enix has a ton of money and thousands of employees, as does Riot Games, EA, and plenty of other huge companies. Nearly all of these companies have developed their own engines in the past, but Unity and Unreal are just really hard to beat: not only can they offer great performance and stability, as well as easy multiplatform support (can publish on Windows, PlayStation, Switch, Xbox, iOS, Android, etc.), but it also can make development easier since new employees likely already are familiar with the engine, versus if you build your own it can take months for new employees to be productive and contribute much of anything to the project.
Often times they'll still make changes to the engine's source code (miHoyo didn't just download the latest Unity LTS from the website or Unity Hub), but that's still considerably less work than building your own engine from scratch, and in many cases even that's not necessary.
On the topic of Square Enix, what's bizarre to me is that FF7R is the odd one out among recent games. FF15 and FF16 were on two different internally developed engines! I wonder if the reason FF7R used UE is because it was originally being developed outside, before Square was unhappy with how development was going and brought it back in house.
What amazed me the most of UE, is that ILM uses it for real time rendering of backgrounds in the immersive LED environment where they shoot The Mandalorian.
But they were at one point. I'm not in gamedev but I do recall people being enthused about it some years ago.
When you lose that audience and enthusiasm among the people who influence next year's technical decisions, eventually you enter the dustbin of history.