This has already happened
All Points Bulletin was started by Realtime Worlds. RTW failed to bring it to completion as they went into administration in 2010 and ceased to exist. Reloaded Inc took over, re-releasing the game as APB:Reloaded, a free-to-play team vs team sandbox shooter.

Doing the Unflinching Walk in the city of San Paro
Now, 6 years later they are still developing the game.
Now granted: this has been tough for Reloaded. RTW left the code in a state that is best called "a complete mess". Despite using the Unreal Engine, RTW had used so much custom code that Reloaded has had a very hard time to develop the game because as soon as they touch one thing, three others break. They have struggled for over two years now to try to replace the old 3.0 customized Unreal Engine with a standardized 3.5 UE, so they can do some actual work on the game without breaking it every time.
Thankfully that work now seems to be coming to a close, as they have gone into a beta release (or "soft launch") of the XBox One version, based on the new(er) Unreal Engine.
So yeah, it is feasible. But do not expect it to be an easy ride.
As for the core of your question:
I was wondering if I were to create a game, would I then be able to sell or
license my game to a game development company that has the resources to
replace my UI with quality work? If this can work, are there any examples of
other people doing it?
You are kind of missing the point here. Coding is not the issue. Development of the game involves so much more than that. What you are selling is not the code, you are selling the concept of the game... the intellectual property that is the game.
Is this possible?
Oh yes... just look at Portal. Not only did Valve buy the concept, they even hired the programmers that made the predecessor freeware game that demonstrated the concept, Narbacular Drop.