All that really matters when learning pieces/music is the process (practice techniques) and physical technique used to learn them with. What is harmful about learning pieces that are difficult, without knowledgeable guidance (and sometimes just having a teacher is not going to actually provide sound guidance, either), is not just about learning wrong notes, but using inadequate physical technique and inadequate practice techniques.
If a person is unaware of inadequacies in these areas, more severe problems can develop both mentally and physically and have longer lasting (detrimental) effects on one's overall development process as a musician (and as a person) than whether or not a single piece has been learned well.
I will admit that I used to feel quite differently on this subject than I do today. But, after going through some major changes myself, as well as having prospective students come to me with severe problems from practicing wrongly for years, I have developed a sense of caution when it comes to all of this.
Every step of the learning process should ultimately be confidence-building ! The process of learning and the physical techniques used to move around the piano will play a very integral role in whether or not a person feels confident in how they are spending their time. Now, with that all being said, it is not so strange to take a few months to learn a piece of music, even with all of the right techniques and processes. Also, it depends on what you would like to do with your piano playing, too.
It is possible to play wonderful pieces with poor physical and practice technique -- what really matters with technique is developing it in such a way that a person can play wonderful pieces wonderfully for the rest of their life !