There are a few phrases that you can use, such as in place (of), instead (of) (also stead), to express the "doing something for somebody", depending on the context.
In any case, the phrase for someone doesn't have to mean that the person you do something for must be lazy. This, again, depends on the context. Compare:
He asked me to do his assignment for him.
I offered myself to do his assignment for him.
Here are some examples of in place (of), in someone's place, instead (of), and stead, I found on the web:
John came to help in place of Max, who was sick.
When the king's cloaked challenge is answered, Fluellen stands in place of him, representing him, and receiving the blow.
She knew she should not have sent him to work in her place tonight.
"O king, take my life instead of hers. Let me die in her place," he pleaded.
... it was Judas who was crucified instead of him, ...
... she had to ask their family doctor to prescribe instead of him making it available to begin with.
Take me instead! Not my boy!
The chairman spoke in her stead.
The marketing manager was ill and her deputy ran the meeting in her stead.
So, you can say any of these followings (choose wisely, register is important),
He asked me to do his assignment for him.
He asked me to do his assignment in place of him.
He asked me to do his assignment in his place.
He asked me to do his assignment instead.
He asked me to do his assignment instead of him.
He asked me to do his assignment instead of him doing it himself.
He asked me to do his assignment in his stead. (formal)
Best Answer
To be "up a creek" or "up a creek without a paddle" or "up s*** creek" is to be stuck in an undesirable place with no way out. This isn't necessarily the subject's fault but is generally considered to be a no-win situation.
To "paint oneself into a corner" is to have, by one's own actions/decisions, trapped oneself with no way out without ruining what's been done so far. With this idiom, the fault is laid upon the painter. It may come off as more of an embarrassment than a no-win solution, since escape is easy but requires re-doing everything—and getting paint all over you.
Going "down the rabbit hole" suggests going or being in an increasingly complex situation, with the suggestion that the time or effort remaining is unknown and prone to expand.
The OP asks for "the only way to get out is to go backward destroy everything you've done and start fresh ... because you have chosen the wrong method at the first step" which fits the "paint yourself into a corner" phrase perfectly. However, it doesn't have the finality of the OP's "you will never get out" requirement, though it does imply "you will never get out unscathed/(covered in paint)."
Personally, when I see someone start off wrong and come to a dead end—for example, in a logical debate—I'll use the "you've painted yourself into a corner" phrase.
When someone is in a bad situation they can't get out of, I'll use the "up (the/s***) creek without a paddle." (Or, if I'm being snarky and think they'll get the alluded idiom, I might say "I bet you wish you'd brought a paddle, huh?")