Prolonged Partial Sleep Deprivation for a Job (The worst year of my life [so far])
Sorry that this is so long, but, I need advice.

I've included a TL;DR version at the bottom.

I'm 25 and I have delayed sleep phase syndrome. Depending on the individual it manifests differently, in my case it presents as a natural tendency to go to sleep each night about two hours later than the night before (8:00 PM -> 10:00 PM -> 12:00 PM) sleeping for 8.5-9 hours.

I've been this way since infancy. In high school it was difficult, in college it was manageable, while working it was unbearable.

Five months ago I left my first job of out college.

I had interned for the previous two summers and was essentially told by HR that I was obligated to comeback full-time. More than that, I wanted to comeback. Up until that point I had an extremely flexible schedule. As an intern I had a loose schedule, typically working more than 40 hours each week, and they were happy enough with me to offer a full-time position.

All of my life I was terrified that my sleep was going to make consistent employment impossible. I was thrilled to have found a job that paid extremely well and allowed for a flexible schedule. My confidence soared. In the three years since first interning I've contributed over 30 KLOC to various open source projects, traveled, and generally lived without fear.

When I started full-time, everything changed.

For the first three months it wasn't terrible. I would usually arrive between 6:00 AM and 10:00 AM, netting between 4-5 hours of sleep on a typical week night. After the first three months I was exhausted. I talked to the President, telling him that I was exhausted and that I needed a change. I was largely ignored. I would take sick days to catch up on sleep.

Six months of this and I was out of my head tired and my performance was slipping. On Friday / Saturday nights I would sleep 12-16 hours and go to the office or work from home during the weekends just to keep up. People started to call me a zombie. I stopped reading, visiting family and friends, and watching tv or movies. I would go home after work each night and just wait for sleep. I stopped existing.

I requested two weeks of unpaid leave, and essentially slept through the first six days. After that I tried to catch up on some open source work. By the end of the two weeks I was wracked with anxiety, terrified to go back to the way things were, but, I did.

The president asked me to see a doctor, and I scheduled an appointment for after the holidays. 6.5 months in, our daily developer meeting was moved to 8:45 AM (from 1:00 PM) and arrival time / meeting attendance was now being monitored. I actually started getting less sleep that I was before, 3-5 hours a night.

I offered to quit, twice. Three months into employment, and about seven months in. If thing weren't going to change I was eager to leave. I stayed because I earnestly believed that they were going to work with me. The president actually said to me: "You have a number of years ahead of you, let's find out if there's something wrong." This statement more than any other made what came next seem like a cruel jape.

Now seven months into my little experiment with prolonged partial sleep deprivation I had my results back from my sleep doctor. I was diagnosed with delayed sleep phase syndrome. A polysomnogram (PSG) was performed and no easily correctible physical reason was found for my sleep condition (restless legs, sleep apnea, etc.) Sleeping pills were largely ineffective.

The next week I had a series of conversations with my direct report and the president of the company. Giving them the results of my PSG, and the diagnosis I requested a schedule change, any schedule change.

I was asked: "What would happen if we don't change your schedule?"

I replied that: "I would have to quit."

Sometime later my direct report came back to my office and said: "We're not going to fire you, as long as you come in on time, as you have been doing. But, we will not be changing your schedule."

I had a lease for another three months and my girlfriend of 8 years (seriously, we had been together since we were 16) had just left me because I was exhausted and working all of the time.

I asked for some time to think about it, eventually telling them that I would have to quit, but, that I would give them my notice two weeks before my lease was up.

I asked if I could have a schedule change to make the next three months a bit easier. The request was denied.

I spent the next three months exhausted and in a state of shock.

About three weeks before I was scheduled to quit, my direct report actually asked for my notice. While giving my notice I practically begged for my job. I, again, asked for any kind of schedule change of any kind. Even offering to move to a part-time position.

I was exhausted and afraid for my job every single day for a year. Ostensibly, this was a fun place to work, video games, snacks, etc. I just couldn't enjoy it on so little sleep

I've spent the last five months living with family and have now decided to reenter academia terrified by the though of living through this again. I'm actually afraid to get another job.

TL;DR Version:

Does anyone else here have a sleep condition?
How do you deal with it?
How do you live?
Where do you work?
Any advice?

I know nothing about contracting, or how to go about starting my own company, but, I see these as my only options.