1-If your company cancel your residency, within 7 days you should leave the country.

2 -Penalty details you have to check.

3 - No, you have to leave the country in order to process your visa for company B and also you have to under go all immigiration and CID process again.