I had a similar situation like yours, but I was in the traditional Sys Admin category.
Basically I had to deal with toxic behavior for a number of years and in reality what happened was to stay where I first started for the whole time.
When they had an issue, I would suggest solutions and useful alternatives, but I would get nothing but "No"s and "don't you dare do such thing!", so they could do their ways. Now, when they would mess up badly with something, they would come back running to me to fix their shit.
I was never trusted nor had they believed in me and my skills to improve our entire infrastructure.
I got tired arguing and fighting for nothing as I was getting nowhere.
Eventually, I automated my tasks to the point of not working, like doing nothing at all for like...4 years or so(?) and right before leaving, I took notes based on my scripts' implementations and then deleted them for good.
Lastly, the headquarters decided to close down our branch.
I don't think I would like to work for such type of environment anymore, but I'm afraid the majority are like this more or less.