Doesn't have to be a dodgy middleman
I dimly recall a story from the 1970s wherein a mid-tier semi manufacturer shipped a bunch of empty packages (no die inside) to the U.S. navy. Their contract had strict penalties for not delivering a specified number of units per month, but no penalty for units that failed incoming test.