Not necessarily "mismatch" or "being setup to fail", it depends entirely on how much mentoring, hand-holding, code-review, test, documentation, wikis etc. there is. Onboarding and managing new hires is a key component of a healthy company culture. Lots of companies pay lip-service to this, few walk the walk.
> Shaming someone for failing never works.
It's perfectly ok to fail (otherwise you'll never learn), and shouldn't result in them getting punished or summarily losing their job, but the person simply needs to show they learned from their mistakes (and there needs to be a culture which actively rewards sharing knowledge and enables people to learn, not just blamestorming or hazing). For example, a company not having a wiki/ Slack channel/ internal/ departmental mailing-list where such stuff can be safely and frankly discussed, and gets meaningful constructive non-backstabbing responses, is a bad sign. But it's common.
> Shaming someone for failing never works.
It's perfectly ok to fail (otherwise you'll never learn), and shouldn't result in them getting punished or summarily losing their job, but the person simply needs to show they learned from their mistakes (and there needs to be a culture which actively rewards sharing knowledge and enables people to learn, not just blamestorming or hazing). For example, a company not having a wiki/ Slack channel/ internal/ departmental mailing-list where such stuff can be safely and frankly discussed, and gets meaningful constructive non-backstabbing responses, is a bad sign. But it's common.