Good question. I doubt it: most contracts have what's called a severability clause, which says that if one part of the contract is said to be unenforceable, the rest of the contract survives as-is. So that probably means that the rest of the contract is fine. Now, there are some other considerations here, because the real world is messy. If I were reviewing this for the employee, I would tell them that there could be other weird situations where showing good faith is important, and this could affect that. The other thing would be suggesting that if a company is putting this in there, it's a serious red flag. If I were representing the employer, I would pull a Lionel Tribbey from the West Wing and go after someone with a cricket bat.
Many times I have had clients asking to include outrageous, unenforceable clauses in employment/consulting contracts. I advise that if the worker does not push back they are either desperate, unsophisticated or think you are full of shit and you do not want to be offering those people jobs anyways. Plus if they did ever want to litigate any part of the contract the judge will think you are an asshole and may decide any issue of credibility against you. 2 years in North America for a non-management worker is incredibly stringent and would not have a chance in hell of surviving in Canada. Employment litigation is horrible for the worker but I like that we at least have loser-pays costs awards here.