1. Play for Orenetis
2. Also play for the people
3. Keep the relationships so that you never fail any of the two sides, stop the people's quest line where you need to free a prisoner from an Outpost.
4. Do the Major Gate repair quest, finish the game with uniting Orenetis with his other side. (you can now leave the valley)
5. Continue to do people's quests
-> When going to the secret complex again, you will be tasked to "escort Orenetis other side" but he isn't there. You can still advance the quest by triggers, even without the "special guest" in your party, but cutscenes are played without the model present and make zero sense.
Generally speaking, allowing to play for other factions after you finished the game for one faction isn't probably such a good idea ;)
I can only imagine the follow up bugs.