I wouldn't say you or the vet failed...You did a great thing. Sometimes, death is just inevitable. At least you tried, which is more than a lot of folks would have done.
Sorry to hear the bad news - but don't let this deter you from doing similar things in the future...