Google is identifying pages on the site that are of little use to the visitor, for example, maybe a product out of stock, or an option selected for a product that does not exist.
Well, it's not really. It's making up URLs using known queries and putting them together in new ways to see what comes up.
It's essentially the same process as making up a garbage path and seeing what happens when they ask for it. (In my case it seems to be triggered when I've added a batch of new redirects and g### wants to be sure they're bona fide redirects and not soft 404s.)
If it's your own hand-rolled code the solution is simple. Go into your php-or-equivalent, teach it to set a flag when results lead to a real page, and otherwise send out a 404 combined with displaying error page. It doesn't have to be the same page as if the user requested a garbage URL; that part is strictly for humans. What matters is that a 404 gets sent out.