Here's what happened:
* "Ghostfreak" episode: Ben accidentally fused with the alien Ghostfreak, a Ectonurite. This resulted in Ghostfreak taking control of Ben's body.
* "Ghostfreak" and subsequent episodes: For a period of time, Ben was unable to revert back to human form, and he had to navigate the world as Ghostfreak. He was essentially "possessed" by the alien.
* "Ben 10,000" episode: Ben 10,000 from the future traveled back in time and helped Ben remove Ghostfreak from his body.
Therefore, Ben didn't "lose" Ghostfreak. He was freed from Ghostfreak's control.
It's important to note that the "Witch" episode focuses on Hex, a villain who uses magic, and doesn't have any connection to Ben's Ghostfreak experience.