From what I understand is you are under your wife's sponsorship and currently working for a company on a 5 year contract of which you have completed only 2 years? So if you break the contract before 5 years they won't give you NOC. If thats the case then you have no legal obligations towards the company and can literally give them the finger and find a new job. No need to fly out to Dubai or whatever nonsense.

BUT, if you are on the company sponsorship and will break the contract, then most likely they will cancel your sponsorship and you won't be able to live here for 2 years!! Your wife can sponsor you to come to Doha on a visit visa, and MAYBE apply for a new RP for you should she meet the Immigration Dept requirements.

Your situation seems complicated and I am not sure I completely understand what your saying here. But thats my feedback. Good luck!!