When Jesus saw her weeping, and the Jews who had come along with her also weeping, he was deeply moved in spirit and troubled. (John 11:33)
The word translated “deeply moved” contains the sense of a brimming over and the word translated “troubled” is a hard word more akin to anger. Jesus wept shortly afterwards. The context is the death of His good friend Lazarus.
As a church we recently experienced to loss of a seven year old who had fought cancer for years and finally died of complications arising from the struggle and treatment. All sorts of emotions arise when you attend a funeral like that. Anger at God might be one of them. But being angry with (i.e. in company with) God might be a better way of seeing it. Jesus is God and He was angry too in similar circumstances.
So what troubled him so much that he brimmed over, wept and was angry? He knew what He was about to do. And it wasn’t too long before that He had told Martha that amazing truth:
” I am the Resurrection and the Life, he who believes in Me will live even if he dies, and everyone who lives and believes in Me will never die.”
John 11:25, 26a
So it wasn’t the death so much as the distress caused by the death that was the issue for Jesus. All that terrible consequence of the fall of Adam. Perhaps He was also thinking of what He had to go through to finally put an end to death.
So, anger is not a wrong emotion to feel at such times. Jesus felt it so there is no good reason why you shouldn’t also.