Earlier quoted context omitted.
I had a similar thing happen with a well-known messaging app startup I interviewed with. This company had me do an initial technical screen (2-hours of work) and expressed great interest in the work I did. They asked me to complete a follow on "work sample" which I promptly completed with extras (error handling, specs, etc). After completing the work sample (a non-trivial amount of effort), they suddenly decided they…
That’s disgusting, and I’m really sorry to have read that happened to you or anyone else. My policy is that anyone that completes the technical screen (2 – 4 hours of work) gets an on-site interview. Just this morning, I had to spend about 20 minutes debugging a candidate’s code to get it to both build and run, but he’s still getting invited for an on-site.
However, it's infuriating to have spent so much time just to learn that the engineering team didn't want me anyways. If I got rejected for a bad work sample - that's fine. Getting rejected because the hiring manager couldn't be bothered to look at your resume before assigning tasks - not cool.
-----
Good on you for bringing candidates in. Technical screens are tough and can be mis-understood by candidates. They should only be a tool to support other data points.