Was that in EU? At least in Germany if those employees work on the same thing/branch/team, this would be quite difficult (from a legal perspective) for the employer to do.
"The protection goes both ways" they say, as you can leave your job and quit with no notice just the same, but it's quite an imbalance as the employee leaving does not generally have any impact on the employer's health insurance, while employees generally do depend on their employer-provided health insurance.
Then again asking about the "EU" is a bad question as every country in the EU has wildly different laws, even now the UK has left.