Oh my goodness, my dd, who will be 5 in a couple of months is doing the same type of thing. She does not listen to what I have to say, like she used to. When I tell her to stop doing st I can see turning into a disaster, like not being ready to ride her bike without the training wheels on, must learn to balance a little first, she either ignores me or gets upset that I voiced my opinion. I think she is at the age where she needs to see things for herself, kinda learning the hard way. I realize this is them striving to be independant . Many times, I let a not so disastrous consequence happen, like I did take off those training wheels (3 days later she asked for them back on), and she is happy bc she learned for herself, not just taking mom's word for it.
When it comes to a safety issue, you're right in stepping in, and stopping the behaviour. I don't have any advice on how to curb this though, I think its a natural part of growing up. It doesn't mean I don't want to tear my hair out at times! lol!