You have the right to get release but not to any company. You are a local hired candidate, even on the family visit visa and without a valid ID. You can get NOC to come back on family visa. Best of luck. If you are going on legal steps, prepare all documents stating your previous visa status, all documents that used to get the family visa. Please note all these privilege will be nothing if the company is firing you for a solid reason. Best of luck.