Entirely this. Don't demand a competent practitioner with the illusion of authority when you're hiring for a patsy to take the fall for failure to deliver due to politics.
Also, professionally, if you find yourself in this environment: GTFO yesterday. It's toxic, and will take it's emotional toll over time. Especially if you're technically talented there's always a market for your skill... keep bouncing until you find a place that respects you as a professional/person.