In my province, we have lots of mines and mills, and many of these sites generate tens of thousands of dollar per hour. The customers do not want any downtime whatsoever, but rarely want to pay for it. This leads to the hammar story.
Someone was called out to a mine to fix a critical machine. The entire
time it was down, the mine was losing over $50,000. It was
unacceptable! So the repair guy came, looked at the machine, hit it
with a hammer, and left them a $25,000 bill.
Accounting was furious, and asked for a detailed invoice. Here's what
they received
Hammer $25
Knowing where to hit
the machine $24,975
So knowledge and time have to paid for, no matter what. Materials should always be covered whenever used, as no one will ever purchase a used product. OK, maybe not "no one", but very few people would accept a used part in an industrial machine, unless they are extremely cheap people.
Your time is valuable, and you need two separate cost factors: your time (non-refundable), and supplies used (non-refundable). But, if the client complains, or what you did didn't fix it, what do you do?
This is where the cost of customer service comes in. Parts should always be charged (unless they're cheap enough you can "give them a discount"), but time is always negotiable. There is a reason there are quotes done, and that's to give an estimate as to the total cost of a service or repair.
If the customer asks you to go ahead with the estimate you give them, you do what you can. As soon as you realize it's going to be too much money, STOP! This is when you contact the customer with your new findings, and new recommendations. If you just discovered this, then first step is to call the client, and explain what you found, in plain English. Your recommendation is to scrap it? Fine, tell them what the cost would be anyways, but let them decide.
No one likes a surprise bill, so you need to make sure you are upfront, and tell your client as soon as you realize there's an issue. They will give you more respect, as they see it as you saving them more money, in the end.
Hope this helps!