I got bored half way through your story.
You are so invested in your your story, and being right that you can't see the forest for the trees.
You feel you are smarter than all of them, but don't understand that your niche in the corporate food chain rides on far more than your technical ability. The corporate world is not a meritocracy.
I'm sure your superiors believe that code is just code and programmers are labor units that can be easily interchanged. I know they think things should be far easier and cheaper to get done than they ever are. That also is not the case.
I am also sure that your code is to some degree an impenetrable mass that only you really understand. Part of that is your fault since at least unconsciously you intentionally propped yourself up to give yourself job security and to make you seem godlike.
I am just as sure that you constantly over promise and under deliver, because you are too eager to please, and want so much to be the star, but don't even have a firm grasp on what it really takes to get a thing done.
Another huge part of your predicament is probably due to a lack of proper "program analyst" function during the design process. I have never met a single programmer, including the most brilliant code writer I ever knew who could be given the task of writing two functionalities and not tangle the two together so that they could never ever be separated again. You have to give absolute blinders to a programmer by never letting them see beyond each little piece they are expect to deliver. But since Program Analysts don't actually produce code, and since most managers and especially executives think it should be so easy they could write it themselves if they had the time, this important function is bypassed, almost universally in small companies.
The rest is just the nature of the beast.
I have seen on many occasions multi million dollar projects hit what I call the "point of maximum entropy" where the code is so complex, tangled, and dependent on specific individuals knowledge of it that they simply can progress no further.
It's not an easy thing to pull the plug on more than a million dollars of investment, but I've had to personally do it 3 times*, although the lead on one of those failures went on to waste 15 million dollars of one of our competitor's money before they too pulled the plug. Hopefully you are not at the end stage of one of those disasters. (*Projects I didn't start, but was brought in to save if I could, too often they were simply good money chasing bad. But they weren't all failures, like this one that had an entire staff working on it for 18 months. I came in, took a step back, and revised the specs throwing out the minor piece that was causing all the trouble. It was a solution that actually enhanced the quality of the overall result, but they all had been too busy trying to solve the problem to ever see past it. The project was then delivered in 3 weeks.)
I have seen frustrations such as yours turn to anger and workplace problems so unpleasant that the individuals had to be fired for cause. I pray that is not you. Nor do these problems go away with just that, but they seem to repeat employer after employer till the person becomes virtually unemployable regardless of their skills.
My advice to you is this, although I know you will not take it, is to get yourself some counseling and learn to relate to your workplace and your coworkers in a different way. For an immediate impact look into things like the Mankind Project or Landmark Education. It has helped some, and others not so much, but remember that just looking outside yourself takes guts and is an important step in the process.
Just remember this: What you are doing now is not working. Doing more of the same and expecting a different result is simply put, insanity.
Good Luck