Some crafting items are forbidden to sell directly to npc, only if have quality in an exceptional level.
This happened because in the past had a uncontrolled production of very very very cheap items using the crafting system, since the shops has a sale limit of 100 or 200 gold each item, but the costs of the production of crafted items are mega-overvalued and abused by players. A side effect of this, the excessive amount of items caused some lag.
About other non-crafting items... Some stuff are marked with "stolen" flag or is direcly refused by the npc traders because icly the npc have zero interest about buying junk...
About ores: Store using commody bundle or trade with other players