Q: What is considered "defective merchandise" according to halacha?
A: Defining "defective merchandise" depends on social norms and the nature of the sale.
According to the Shulchan Aruch, "Anything that the area's people agree is a defect that invalidates this sale can be returned; anything that they agree is not a defect cannot be returned… because whoever buys and sells relies on the local practice (C.M. 232:6)." Nowadays, there is strong emphasis on quality control. Many defects would invalidate a sale. This depends on whether the item is marketed as high-quality or cheap.
A regular book with one misprinted, albeit readable line would probably not be considered "defective" (although the printer would have to provide a proper patch for those lines); if a line is missing from the book, that is a defect. A cheap pen that sometimes writes poorly would not be considered defective, while an expensive pen would. A piece of furniture that is noticeably scratched would be considered defective.