But there are times when the situation is not perfect, but you still don't want to leave. These can be good times as well. If the project has little or no chance of success, why not experiment with some unconventional techniques? It could be your last chance to do something like that. Working in a group which is failure tolerant can be liberating as well.
Finally, make sure that you fully understand the business decisions before you go overboard. In the very first start up I worked in, the management pushed estimates that were wildly inaccurate. We'd say that it would take 4 months and they would promise 1 month to the customer. We failed every single time. When we finally got to a product launch, many years late, I asked the CEO if he wouldn't have rather known at the beginning how long it would take. He smiled and replied, "No, of course not. I would never have gotten funding if I told people that it would take this long."
There are things that we, as programmers, know very well. There are things that we do very well. This is also true of business people. Sometimes we, as programmers, can't understand what they are doing because we aren't business people. Sometimes in our hubris, we think we know better than them.
Knowing who to trust in these kinds of situations takes time and experience.
It's true that software budget estimations are by their nature educated guesses at best. But we should still make an effort to be honest about them.
Usually the technical debt will accumulate to the point the product can no longer move, is stuck on an outdated stack, and dies.