Had two situations one in government and one in private industry where I was stuck with projects assigned to me by bosses that would make Dilbert's boss look like a Nobel Prize winner in Physics. In both cases I was asked to work on something that was physically impossible to do. One would have required me to build the equivalent of a “perpetual motion machine” the other violate the fundamental tenets of information transmission. It was a challenge to maintain my personal integrity and yet be a good employee. I survived, but it was an “eye opening” experience for a relatively young lead engineer. (All the while I was going through this I kept telling myself and my wife how much more happier I was back on “the bench” or “programming”! Of course I was making so much more money as a “Lead or Chief Engineer”)
It taught me some important lessons. One be alert to early on project discussions. This is the best time to be on the look out for similar “sticky” situations and either head them off or find a reason and a method to get out of the way. (None of that was covered in undergraduate or graduate school! From those experiences I learned I was required to deal with people without resorting to Alice's “Fist of Death”! — another Dilbert character who is a female engineer. However "Fist of Death" would have been far more psychologically satisfying.)
Yeah, I'm glad I retired when I did. The department I worked in had been going downhill for a while, and it was evident it was only going to get worse. When I had the opportunity to retire, I did. Every now and then I'll run into someone I used to work with, and they always tell me how smart I was to go, while the gettin' was good.
I'm glad you survived the crap they threw at you. Even though I raised cain during my career, I tread lightly, didn't do any more than what was required of me because I didn't want to give them anything to go after me for, and I made sure I dotted all my i's and crossed all my t's on official paperwork handed in. Thankfully I survived, and there was great camaraderie amongst the rest of the peons I worked with, because the majority of us were like-minded, and were all in the same boat.