According to the Urban Dictionary, this expression has been used for centuries to explain how someone has been placed in an emotional state that would cause them to be “out of one’s mind” because of strong emotions. Forms of the expression have been around from at least the 15th century. Other versions include “…beside oneself, out of one’s wits, out of one’s senses. An example that I found to be quite odd is, “I was so beside myself looking at all the women on the beach that I hadn’t heard my wife yelling for help.” That would be the statement of a man in trouble, but it doesn’t seem to match someone in such an emotional state that they were “beside themselves.”