I guess it is a pretty common feeling more or less everyone had at least once: Your boss is talking to you and you think "what would happen if I would just tell him to shut up". Very similar is the feeling of driving on a highway while thinking "what would happen if I would just drive my car into the oncoming traffic?" Or the feeling of standing on the edge of a high building and thinking "what would happen if I'd just jump?".
All these thought have in common that, if actually done their consequences would be more or less self-destructive.
I know there is a French word for this exact kind of feeling but I cannot remember it. It would be great if someone could help me.
The word I was originally looking for is L'appel du vide as mentioned in my answer below. It seems like this is no widly known term (the fact that no native speaker came up with this is the best proof) therefore I accepted the answer idée noir which seems to describe a very similar feeling and is a common phrase.