He was an off-duty pilot catching a ride in the jump seat behind the pilots in the cabin, which is completely normal. The guy being a fucking lunatic is where things went wrong.
He was running on over 40 hours with no sleep. The shrooms were out of his system, since he had taken those over 48 hours previously. The lack of sleep caused him to have a disassociative episode. The airlines caused this, with their policies and corporate culture, and are desperately trying to absolve themselves of responsibility so they can keep overworking and underpaying their employees.
This isn’t a railroad car. Deadheading on aircraft mean the company is getting you from one place to another. You’re on the clock, on duty, and generally must be provided a seat in the back.
Jumpseating (usually for commuting) is when you travel on your own time, own dime, typically done before or after a trip. You may be provided a seat in the back, but if there are none you may be granted access to sit in the cockpit jumpseat. You are on duty when jumpseating and considered part of the crew.