Your LMIA was approved too late and that's why your work permit has been refused. You'll need to stop working immediately and then submit a restoration application to restore your status back to a work permit. You should expect it will take 4-5 months for the restoration application to be processed.