I think your example is actually a counter example.
This is also how most people, regardless of age, learn.
The key is - did you have to warn your son again?
I subscribe to natural consequence parenting within guardrails. People learn from experience reliably, the key is to allow manageable consequences.