1) Extremely regulated fields with strict education, training and certification requirements (eg: a physician)
2) Fields where you have to show something. Designers frequently need to have extensive portfolios. Carpenters need both that and real world referrals of happy customers (not just nearly automated HR checks we have in software dev where no one will say anything bad out of fear of getting sued)
3) Trial period followed by sink or swim. Come work for us and if it doesn't work out we'll demote you or fire you. There's a few places like that (I think its Netflix's model?), but generally firing someone has everyone around calling foul.
Thats absolutely my personal preference. The argument against it (very valid), is that if someone with a family relying on their paycheck quits their job to go work at another with that policy, and gets let go after 3 months, they're kind of fucked.
We could have this for our field - and to a certain extent we already do, at least via a github repo. Only problem is, nobody seems to look at them.
People have mentioned that SWEs should have a portfolio - but I've never worked for a company they let me take home code and put it in my portfolio. For web development, I may or may not be able to point to a specific site and show someone "see this here, I developed this part" - and even if I could, how would I prove it? Most of the time, it doesn't matter - as that code/feature/website is likely gone or changed by that time.
So you only have a couple of options to develop a portfolio, and those options only work for some people, not all: Either contribute to an open source project, or work on your own side-projects, putting them all up on github or similar repository you can reference.
But not everyone has the time or inclination to do this.
There are significant pushbacks in some communities that this isn't inclusive, because people can't spend that much time outside of work hours to build one (and as you pointed out, internal code can't really be included).
Graphic designers and stuff are always sketching/drawing stuff on the side for their portfolios though, and that seems pretty expected, so... /shrugs.