Can your company move ahead your last working day?

If you don’t have the right of permanent residence, your contract is automatically a fixed term contract, no matter what the contract says.

But if your contract gives you the right to terminate it anyway, then it depends on the wording of the contract. Assuming they didn’t sneak in a loophole (either in the contract proper or in the work rules), you should be okay.

Check with a lawyer to be safe.