One should not play a practical joke on someone if it shows contempt for that person or if one believes it might bring significant harm to that person
I should not have played that practical joke on you yesterday. Even if it was not contemptuous, I should have realized that it would bring significant harm to someone.