first of all you’re not a failure – your little one can possibly sense how your feeling and it could be contributing to the whole thing.
Secondly -is there a medical reason possibly kidney infection or the like that maybe started it off?
My dd1 was a dream practically trained herself but dd2 ha she just wee’d everywhere was going to give up but she could sleep dry, she could go for trips in the car and stay dry just when we were at home she went anywhere, anytime, she was only 2 & 5months at the time, we got a star chart, explained that she needed to use the toilet for a wee and she’d get a sticker each time she did it and when she filled the start chart we’d take her to toy shop and she could pick something – worked eventually, the toy/reward at the end doesn’t have to big just something they want and something for them to aim for – hope it helps.
btw my dd2 is now 3+ and suffered there a while back from a little tear and as a result was holding her bowel movements, she got into a habit of having to have one of us hugging her/being in bathroom with her doing her poo’s, we implemented the star chart again to try break the habit and it’s working. good luck