This doesn’t sound like a failure at all
In the most literal sense, you set out to live as a digital nomad and for a set period of time and you did just that.
As with any lifestyle change, living as a nomad has quite a learning curve. Sounds as though you made some choices early on which knowing what you knew at the time were wonderful choices. However, after learning that perhaps your accommodations weren’t the best choice or that working out of cafe’s isn’t the easiest you can adjust.
Productivity while on the road is a tricky thing. I’ve had to accept that when in a foreign country I’m going to want to explore, eat the food, drink the drinks, and that’s quite alright. I’ve been able to strike a comfortable balance between this and getting things done by never working more than two days in a row. Ever. When I’m working, my head is down earphones on and don’t distract me. When I’m not I’m enjoying the sights and I don’t feel guilty about it because I worked yesterday, I’ll work again tomorrow, and today I’m relaxing.
Another very important thing to remember when traveling the globe is where ever you go, there you are. If co-working spaces are your favorite place to work while home, work from them on the road. If you don’t live in a party flat at home, don’t live in one on the road. No matter what you’re still going to bring yourself with you everywhere.