In English "to shoot oneself in the foot."Btw ... I am looking for a phrase in Bahasa Indonesia (or a good translation).
In Dutch there is a phrase "Throwing in your own windows" ... meaning something like "You ruin your own case" or "you ruin it for yourself". Maybe in English there is a phrase like this too.
But: what's a good translation of this phrase in bahasa Indonesia?

shoot yourself in the foot
1. to do something without intending to which spoils a situation for yourself…
SHOOT ONESELF IN THE FOOT Definition & Usage Examples | Dictionary.com
Shoot oneself in the foot definition: . See examples of SHOOT ONESELF IN THE FOOT used in a sentence.

In Indonesian, I am not aware of any specific idiom that matches, but there is certainly always a specific phrase that could be used, such as 'aksi bunuh diri' (e.g. suicide action), etc."