In your examples, it seems that you're stuck and whatever you do next will be a bad move. You can call it a
no-win situation/lose-lose situation
a situation in which a favorable outcome is impossible; you are bound to lose whatever you do (TFD)
You can also use the chess term zugzwang
Zugzwang (German for "compulsion to move", pronounced [ˈtsuːktsvaŋ]) is a situation found in chess and other games wherein one player is put at a disadvantage because they must make a move when they would prefer to pass and not to move. The fact that the player is compelled to move means that his position will become significantly weaker. A player is said to be "in zugzwang" when any possible move will worsen his position.
This is a bit esoteric, but the best fit IMO, since it denotes the compulsion to make a move when you rather wouldn't.
Or a Cornelian dilemma
A Cornelian dilemma (dilemme cornélien) (also spelt in translation with two "l"'s i.e. "Corneillian") is a dilemma in which someone is obliged to choose between two courses of action either of which will have a detrimental effect on themselves or on someone near to them. In classical drama, this will typically involve the protagonist experiencing an inner conflict that forces them to choose between love and honour or inclination and duty.