No employer can force you to either stay in the company nor bar you from leaving the company. Its against the very nature of Labour/employment laws.
For appropriate legal advice, I need some details and clarifications. You may reach out at firstname.lastname@example.org.
Adv. Akshay Lal
Taarkik Legal - Advocates & Consultants