Before you exit, have you actually told your bosses in no uncertain words what the hell is going on? It sounds like this is a breakdown of effective communication and assumptions about what people want in their career and what they need. If you haven't explicitly aired these specific complaints I think you should at least give them a chance, which for you, could also give yourself the fastest path to build something you could show off, instead of having to start over at a new company where there will be a lot of unknowns. If you have already done that, I'll show myself out.
I was in a similar position once. I was working at a green tech startup, took about a 5x pay cut to work there, but it was something I was passionate about.
They had me working on low value BS, internationalization of an old product, etc. Just wasting my time. I don't think they had any idea of my capabilities (despite lots of proof of that).
When I finally said "I really want to be challenged here, I'm super capable, and I want to drive forward on meaningful work", I got no response, and shortly thereafter was laid off. Funny place. I then took another high paying job that assumed I was capable and pushed me hard - much better!
Sometimes you're just wading into interpersonal dynamics and low trust environments. If it's consistently weird, there really is just one choice: find a place that's doing hard work and will value your contributions. Life is too short to waste it with contributions to those who don't value them.
Yeah (in the US, depending on state) plus when you get paid off you get severance, maybe even unemployment. At least you know where you stand. If the bosses are truly assholes, you know where they are. I think it's entirely possible in many cases they just don't realize what they are doing. In another situation they might be truly wanting interchangeable low value programmer, so tell them it's not a good fit anymore, I'll help you hire my replacement, please leave me a good letter of recommendation on the way out, and you get that.