Tolkien argues Frodo didn't fail, and that's his point. None of us can save ourselves. We can only do all we can, but
none of us can do everything. None of us. Frodo did all he could, and in the end, it was grace and mercy that saved him, the grace and mercy that had been extended much earlier to Gollum. It's one of the deepest and most Christian symbols in the entire story. Tolkien wrote about it in some excellent letters that are worth a read.