What do u call a person who does a different thing even though they were told different

A person who does a different thing even though they were told otherwise can be called independent, rebellious, defiant, or disobedient.

More of like on accident like they didn't mean to do it

In that case, you could simply call them forgetful or absent-minded.