I don’t believe carry-on allowance is a legal requirement, but it is an airline rule.
No fine involved, unless there’s some sort of intra-airline bonus-holdback or something.
BUT - “it’s illegal”, “we’ll get fined”, etc. are often code for “I don’t want to get in trouble if someone else sees and complains.”