Words aren't absolute. No reasonable interpretation of my comment suggests I'm saying you should do the impossible.
If someone asks you to do the impossible you have to say no. Better yet, you should figure out what they actually do want. They can't get the impossible, that's not on the table.
The worst thing an engineer can do is not learn how to say no.
I'll even say, if you don't know how to say no then you're not qualified to be a senior
Your assumption that seniors will be able to output good code in any situation is what is the issue.
As a senior I've been tasked with impossible tasks, with insane deadlines, in ""enterprise"" code bases. Sure, saying NO is an option, but being the NO guy is surefire way to getting fired. And nothing looks better on resume than repeated firings.
My CTO, when told that adding scope, reducing headcount, and keeping the same timeline all while discovering new unknowns in the codebase was not possible, we were simply told to make the date and asked who's performance review will be impacted. The "no" was entirely ignored. "I don't accept that."
How do you say no in that situation? Just quit?