I don't see why a law can't be inmplemented that if a company terminates your contract (and you haven't done anything illegal) then a NOC is automatically given i.e the company has no choice but to give you one.  But I guess this is common sense, something Qatar authorities lack in abundance it seems!