The "follow the recipe to the letter" was not a rule displayed before the exam. The way he refered to that even let us think he stated that rule as a convenience to fire Megumi.

And as I said, he can fail her for that test and then offer her a way to save her neck to show respect for her hard work since she got a more than satisfying result. Or he should have failed her early. Failing her that late with no options is just pure sadism he savoured the moment he saw her using a less than perfect cauliflower.