I am trying to find an idiom that describes someone setting hurdles for themself or putting themself in a more difficult position every step of the way, eventually trapping oneself or forcing one's back against the wall. The English phrase I have in mind is "paint oneself into a corner", as in:
If you keep doing that, you are just going to paint yourself into a corner.
What would be an apt Japanese phrase for this? I've thought of 自縄自縛 and 墓穴を掘る. I think 墓穴を掘る is probably closer to what I am reaching for, but are there better ones out there?