Makes sense, otherwise this is a very easy way for spiders to realize they're in a trap. I'm pretty sure Google tests bogus query strings to see what the 404 page looks like.
Some legit websites instead of displaying a 404 error, they redirect (3xx) to a page like the main page or about.
http://inf.demos.dam.io/sdfsdfs
I have yet to find a pattern, but I guess the author did some sort of hashing to the query string and use the hashcode as the seed to generates random text. For some given strings, the backend fail has to do with the use of the hashcode probably. (e.g. use [some_variable_or_constant_here]/[hoshcode - CONSTANT], when hoshcode == CONSTANT, the backend code does not contain the exception handling code.) Just a guess.