Your country matters because charging a restocking fee is against the law in some countries.
You already got your answer to the original question: the restock fee is justified if you return a perfectly fine machine because they have to resell it as refurb which will be discounted.
You have a faulty machine, by your account, so there is something off in your story as Apple will generally abide by their own BTO return policy (which you
clearly have failed to read).
Why don't you calm down and answer the logical questions being asked so that we may help you because bottom line, Apple's QC department is non-existent and you are probably well within your right to get a replacement machine or at least a repaired machine.