This is conflating 2 different situations:
(1) Competent programmer who isn't a good fit for a particular job.
(2) Incompetent programmer, the "can't code, can't even write a for loop" bogeyman that seems to scare everyone.
Coding interviews — whiteboarding, take-home projects, and the like — are intended to filter out (2). But they aren't good at filtering out (1).
(1) can always occur. There's not a great way of avoiding that until they actually get on the job. Of course it's unpleasant to fire somehow who doesn't work out, but I don't see how take-home assignments are supposed to help here with (1). Whereas the (2) people shouldn't be in the industry at all, and they're lucky to somehow scam someone into giving them a job, but the industry should not be financially supporting scammers or their families.
I'm personally not convinced that (2) is as big a group as many people believe it is.