I would disagree with this. The actual age of an actor will color their character. Movies have many moving parts and they need to flow and support the film. That could be the score, the camera work, the pacing and, yes, the appropriate actors. Actors, even good ones, that distract from the plot isn’t good casting.
For example, Tom Cruise was cast as Jack Reacher. But if you read this thread, you might come away thinking that was not a good casting choice, even though he was excellent in it, simply because of his size.
Despite of how good an actor is, if they are too old, too tall, too white, or too anything that provides a distraction, I would question whether it is good casting.