Porting is a relatively big issue. Core game systems often intertwine closely with how the engine operates, especially graphics systems like the renderer or particles/effects. It's totally possible though. One of the game projects I help with switched from SFML to Godot to an in-house engine.
There's also the 'skilling up' of a dev team. If a studio has developed on Unity for 10 years, switching to Unreal or Godot or similar will be... Challenging.