Coming from someone who learns pieces in a similar way, it's likely a bad habit. I memorize nearly everything I play, however, I do it with the expression in hand. I did this early on in my training (I've been playing for 6 months) because I felt pressure to perform well from my teacher, because in a university setting I was worried if I didn't perform he would drop me as a student. So instead of working on my sight reading ability, I simply listened closely and memorized it, as it was the easiest way to minimalize my mistakes in lessons. There's a price for that which I'm still trying to mitigate, as my sight reading ability is exceptionally poor for the level of pieces I am playing.
Additionally, if you are learning only the notes, then you will only play the notes and not the feelings of the piece. In my, albeit limited, experience I play a piece in performance the way I memorized it. If I memorized it with a wonky fingering, or a specific interpretation, no matter how I worked on it later with my teacher, the performance stress brings out those initial internalized workings. This is why I'm now extremely cautious about reading pieces for the first time, as I memorize I pay the utmost attention to every detail. Once you've internalized something it's incredibly difficult to change that!