The second instance, I feel I can comment on, though allow me to leave out details to spare the people involved public embarrassment.
There, the changes, whilst annoying and born out of a complete misunderstanding of a core part of their alleged competency (Imagine a Botanist telling you leaves are always blue because that is the color of the sky), were not going to break anything, just look silly and create unnecessary, but compensated, work.
In that case, I also viewed the specific project finally launching as vitally important to our user base and wanted the results to go public for their benefit, so the decision was made to document and execute on their requests, so we could go live.
Of course, two weeks before our go live date, they changed their requests again ("leaves are not blue, they are violet because of the wave length of light") and had a hard time understanding that changes can have a knock on effect and some things are a bit more complex than Find and Replace. If I had been forced to make those changes at that point, I'd have packed my bags.
Simply said, when my work has the potential to benefit users and I know that arguing, even though I am correct, will lead to massive delays, I'd rather just put that silly request in writing and deal with these things after the users have received what has been worked on. Try to explain when someone is wrong, but if that doesn't work, finish the project, argue later.
Of course, if after the fact responsibility isn't taken, that finished project gets mentioned in my CV for the next employer.
As an industry we need to stop perpetuating this idea that everyone is fully mobile and software engineers are some mythical creature that isn't also shackled to the same constraints the rest of the labor force is. It's a job and a lot of people are dependent on a steady income stream. Part of that is putting up with the least worst of the options they have reasonably available to them, or sometimes taking up worse options just because it balances other aspects out. Ultimately during certain times you may have more or less leverage to put up with or reject crap practices. SWEs tend to have a lot more leeway than say a retail worker of course so we can be a bit more demanding but we can't just say crud off, I don't deal with any BS, even in the best of times. Higher salaries give you some negotiation room as well as you can lower your TC expectations in terms of negotiating better working environments (i.e. taking lower rates but demanding things like less pressured schedules, make autonomy, etc.) and as the extreme sof the markets are high enough, even taking TC hits can still let you live comfortably (this is to contrast many other professions who don't have this flexibility).
Unless you've lived modestly and invested significantly or started some side venture to become financially independent of labor based income, you're ultimately giving up some degree of agency to employers. We like to pretend this isn't the case but it is the case for most people, even highly paid labor.