Visa rejection, do I give 14 day notice?

Hello all!

My change of status of residency from student to Working has unfortunately been rejected and I will be leaving Japan soon. From what I understand, the current 30 day "designated activities" visa that I am now on for preparing to leave japan, does not permit me to continue working until I leave.

Not a problem for me personally, except my company demands I give 14 days or they'll withhold some of my final paycheck or persue claims for damages (especially in my case because I am the sole person running multiple programs/projects)

So I'm kind of stuck between a rock and a hard place between working illegally for 2 weeks or resigning today.

What I am curious about is, are there special circumstances for immediate resignation when it cant be helped such as this case? If they tried to withhold pay or pursue damages, would it hold up?
Any information would be helpful! Thanks!

Edit: my contract is a non fixed term bailout contract. I only have the project manager responsibilities because they were going to put me on a seishain contract once I received the visa.

by turt_stomper1327