You can always ask and agent to give up part of a commission to put a deal together but, an agent is not required to give back any part of a commission when they are receiving both sides of the transaction.
The agent has already negotiated a commission with the seller. It's up to the agent if they want to give back part of the commission to put the deal together.... more
It's very hard to say whether or not this was ethical or not. Unless you know what the owners specific instructions were, or can prove that the agent, or owner, knew there was a well issue, its a grey area at best. You might want to look at the Property Condition Disclosure to see what it says about the well or water problems. If it says No or Unknown, then its hard to question the agent's ethics.
The agent may have had no idea that the owner would refuse any repairs. Sometimes owners are not always honest with us until its decision time. If the owner accepted a contract with inspection contingencies, then technically it was not an 'as is' sale even if he/she was not willing to grant any repair concessions.
I think it is unfortunate for your buyer. If you talk to the agent for the next house they want to make an offer on, explain how they got burned, maybe you can get a sense for how resonable the owner is likely to be towards needed repairs.