If it takes more than 2 hours, there's a pretty good chance it's the wrong job for the person doing the challenge.
And for every company that means it there are five others want to find people that will sink massive amounts of time into these so they can do the same once they start.
Presumably you can't tell if the applicant spent 2h or 6h, and in practice the 6h solution is probably going to look much better. So sure, in theory you may be right, but in practice I bet you select for people who spent (much) more than 2 hours.