Going in front of the person who is in a bad mood and trying to speak to him, is like giving him the permission to spill all his negative emotions onto you and later crying over the spilt milk.
This also tells us that we need to respect ourselves more and have a boundary.
Respect yourself and other by giving space at right time.