Sure, they can do that, but they can’t stop you from leaving. That would actually be a felony criminal offense if they did.
I never said they would