When the whole dev team is in on it it's actually not too hard to bake in extra time for the unseen things by just everyone taking longer than they would if they were doing purely what the managers wanted. (Though ideally by doing some of the unseen things the total time for future work will become less than it would have because you don't drown yourself in tech debt by trying to do the PM's MVP only every time... It's nice to have a PM who understands that tradeoff.)
My first real junior dev job [1] gave me an ulcer. I only relaxed when I realised what you allude to: people yelled at me and complained about my working pace (and the fact I didn't... smile) but there wasn't anyone else willing to do the job I was paid a pittance to do, especially not with that money. I could just take my time and do my best in the time I thought was appropriate and let middle management go screw themselves. Poor bastards anyway- they were the de facto product testers so they probably had it worse than me in the end.
[1] In other words, working for a company that didn't give a shit about me and just used me in a "human-wave" sort of approach to development. This also came after a stint at a company that treated me fairly and gave me a full "software engineer" title, no "junior"s, so I had the chance to observe the difference between the two models very closely.
I get tasked with delivering arbitrary deadlines for impossible features and timelines to my team and managing the outcomes.
There really are no other reasons for some of these deadlines other than higher mgmt. competing against each other. There are no business reasons.
Long ago I just started ignoring them and giving my team deadlines that were both reasonable and obtainable. I don't want anybody stressed on a daily basis.
If mgmt thinks they can do better, go for it.
I've become especially cynical of highly marketed "shiny" third-party things that are actually completely broken when it comes to technical innards:
MongoDB, Segment analytics, Unity3D game engine, to name a few...
Ahhh yes. Fancy website? Grandiose claims? Piece of crap.
Essentially plain text site? "just a tool"? Couldn't live without it
Aye, and that person would be called a "junior developer".