In psychoanalytic terms, Frodo did not fail but succeeded. The success came through the fact that Gollum can be viewed as Frodo's Shadow, or a part of Frodo’s ego that only split off due to repression and guilt. The Shadow or Double can also be seen as a Messenger of Death, making us face our own mortal being yet immortal soul. As you can see, Gollum is actually that part of Frodo (and every human's ego) that is repressed, (the pleasure principle and the id), as we move from childhood into adulthood. Gollum's actions establish the reality principle in Frodo’s life, which is what all of us face as we move from childhood into adulthood. Frodo no longer longs to go back to the Shire, for it represents childhood, and he has come to accept death and the passing of life, which is more than most of us can say. Man, Aragorn, adulthood has been established in its rightful place in the passage of life.
(Of course, on the flip side, the installation of the reality principle could be seen as a neurotic symptom of the human race in general.)