A lot of these labor laws get less protective for higher-ranked people in a company, whether it be due to thresholds based on compensation or explicit carve-outs for executives/board members. It varies a lot from place to place.
In US and English law, "specific performance", so a court ordering you to do what you promised, isn't available for personal service contracts. In the US that's reinforced by the 13th Amendment's ban on involuntary servitude. So even if a CEO signed a contract promising 6 months notice and a smooth handover, the company can't make them do it, they can only enforce any financial penalties that are contracted.