Hi Sophie -
The temporary residence permit is basically your visa — you can stay in China as long as you have it, and come and go as you please. It’s completely separate from the work permit as well, so it’s legal to have the temporary residence permit still, you just can’t be paid.
This means that even if you are getting terminated, depending on the leniency of the company they may allow you to stay on your residence permit for some time after to find a new job.
On the flip side, they do want you to get the permit cancelled. They could get in trouble if you apply for another Chinese visa and it’s apparent that you were abusing the business visa they gave you. However it’s my understanding that this would have to be a pretty serious case — overstaying your visa for 6 months or something similar — so they still are not hard pressed to make you turn in the residence permit.
If I was in your situation the first thing I would do is see if I could ask my company for some time before turning in the permit. Perhaps if you ask them directly they will say yes.
If they say no then there are still ways to push the system that are safer than others, but hopefully it won’t get to that.
I’m also curious about a couple things —
1. How long do you need to wrap up your life here in China?
2. Where are you from?
3. Your company made you sign a contract saying you would cancel your resident permit, did the contract say when you needed to do that? What specific terms were in this contract?
Good luck! I hope that this helps.