That sounds more like a problem with the API than the front-end. That or horrifically faulty means of implementing the front end...
Which with all the outdated, outmoded, copypasta programming out there that's not surprising either.
Though did you have control over both ends, or were you being bent over the table by a third party API?
Generally what people consider "elegant" in TypeScript I just find to be obtuse... and if you can't trust the information coming from the server, whatever you're doing server-side is garbage. No amount of type-crafting, type-manipulating, and mostly incomplete attempt at typecasting is worth the headaches.
I mean, I'm guessing wildly and might be wrong, but it sounds like you threw more code and complexity at the problem than fixing the real issue.
But that too hinges on how bad the existing code was. It's easy to crap on vanilla code when you are looking at just plain crap code. That's my problem with a lot of JS is that what people write is just such utter trash, it's no wonder they get suckered by frameworks, transpilers, and other con-artistry.