Extreme joy, anger, etc, brought on by a situation that causes one to be "out of one's mind"
with that emotion.
"Beside" was formerly (15th through 19th
centuries) used in phrases to mean "out of a
mental state or condition, as 'beside one's patience, one's gravity, one's wits'" (Oxford Engl. Dict.), and that use survives only in "'beside oneself': out of one's wits, out of one's senses."