I think we’re born with “bad habits” – that is, random habits. For every type of thing we try to do there’s a natural, random, solution we first figure out – and all the little differences in the specificities of how it’s done are usually sufficiently inconsequential for the problem to be solved regardless of the inanity of the first attempt.
The process of mastery is attaining awareness of the humanly features that comprise a skill, then understanding a correct way of doing it, and ultimately with repetition establishing habits that replace the de facto preexisting random “bad” habits. I think ultimately, a bad habit is just a bunch of otherwise good habits munged together, it’s just noise in the neural wiring. There are several independent different great ways of achieving a particular class of results. Mastering each way, and then deliberately choosing the most elegant one for the situation is ultimate mastery.