Short answer. Not automatically, but it may be raised against you. Article 172 withholds compensation only where the injury was occasioned by intoxication, a wilful intention to injure or kill, or notorious negligence. Ordinary carelessness, including breaking a rule, is not the same as notorious negligence.
What the law says
The State Insurance Fund shall be liable for compensation to the employee or his dependents, except when the disability or death was occasioned by the employee’s intoxication, willful intention to injure or kill himself or another, notorious negligence, or otherwise provided under this Title.
Labor Code, Article 172 — Limits On Fund’s Liability. Read the full provision →
The exceptions are a short and specific list
Article 172 begins from liability and then subtracts: The State Insurance Fund shall be liable for compensation to the employee or his dependents, except when the disability or death was occasioned by the employee’s intoxication, willful intention to injure or kill himself or another, notorious negligence, or otherwise provided under this Title. Nothing in that list is fault in general. The scheme was not built to reward careful workers and punish careless ones — most workplace injuries involve some human error, and if error alone defeated a claim the Fund would rarely pay anyone.
'Notorious' is doing real work in that sentence
The drafters did not write negligence. They wrote notorious negligence, and the qualifier is what your case will turn on. It marks out conduct of a different order from an unbuckled harness at the end of a long shift or a shortcut everyone on the crew takes — something conspicuous, deliberate in its disregard of an obvious and known danger. Where the line falls in your situation is a judgment on the facts, and it would be wrong to tell you it is a formality either way. It is the point to prepare for.
The injury has to have been occasioned by it
The article does not exclude a claim merely because the worker was doing something wrong at the time. The exception applies where the disability or death was occasioned by the excluded conduct — that is, where the conduct caused the harm. If a guard was missing from a machine, or a scaffold gave way, or a vehicle failed, the rule you breached may have had nothing to do with what actually injured you. Keep that distinction in view, because it is easily lost once an incident report starts assigning blame.
What tends to decide it in practice
Facts, gathered early, while people still remember. Whether the rule was written down and actually enforced, or observed by nobody. Whether the equipment or protective gear it required was in fact provided and working. What the supervisor instructed, what the production pressure was, and whether others did the same thing daily without comment. Photographs, the incident report, the logbook and the names of everyone present are worth securing now. Read whatever the employer files before you sign it, and correct anything in it that is not what happened.