It does tho. Not all cassettes are built on the same tolerances and different brands might have different interpretations of the standards, so always check the limits.
Cable tension more often then not can be dialed on the derailleur as well.
Worn chains can impact shift performance, and sometimes adjusting tension or derailleur height can improve things.
These are things that aren’t noticed when everything is new and clean, but can slowly creep up as an issue.
So yes. I agree with your sentiment that a well set up derailleur should keep shifting, in practice it’s more nuanced.