No it's not a bad thing at all. Learning and the ability to learn is absolutely fundamental to being a good programmer.
The important thing when building something from scratch is to finish it to completion. It doesn't matter how hacky and unoptimized it is, if you complete it there's a sense of satisfaction like no other. It will all give you valuable experience and you can always make the code more elegant or perform better later on when you've got something functional. At the end of the day, the only things separating awesome programmers and mediocre ones are experience and practice.
Of course when you've got something done and want to create further games, there's no reason to reuse your old codebase.
If you're looking to start a career in game development, or any kind of development really, experience will take you very, very far. But if you're looking to churn out games quickly and easily (relatively easily, compared to writing your own stuff) use an existing engine.
To be honest with you, a combination of experience using your own code AND using a variety of different libraries and engines will make you a far better coder.