When the company succeeded, due in part to the systems I built and designed from scratch, I was unceremoniously asked to leave a few weeks before the transaction closed for many millions. I was asked to leave because as we drew nearer to a sale of the company, I had the nerve to ask for the company to put on paper how I would be a part of that transaction, since I had been verbally promised that "a rising tide floats all boats" and I would be rewarded handsomely for my work. Mistake #2 of 1000 then, accepting a verbal agreement over one in writing.
In the end, when I asked about getting it in writing so close to the sale, I was asked to leave. When I said, "but, you told me I was to think of this like a family", I was told, "we thought you were smarter than that".
That episode did a lot of damage, and I never saw anything meaningful in terms of compensation- the owners got fabulously wealthy.
I made many mistakes then, and I could have pursued legal action, but it was all too painful.
Since then I always try to insulate my feelings and remember that in a professional setting I can always do my best and be professional, but to always remember that to others, it really can be "just business". It's important to keep some distance and avoid emotional abuse at work, both doing it and receiving it.
It's not to say we can't be friendly, but just to be professional, honest and ethical in the workplace, always.
Edit: I meant to mention, that in this job, I was working for the "changing the world part", but when I saw the imminent sale coming and I had nothing, felt I had to ask if I would be a part of it. Back then, it was a mistake for me as well, to assume that I was going to do good and get handsomely rewarded and expect that the two would come together. I think it can happen, but I learned the hard way how to compartmentalize changing the world and getting paid with simply doing necessary work to get paid and survive.