Praise be to Allah.
There is nothing wrong with this transaction, which is delegating him to sell the gold in return for a fee of 10 riyals for every gram.
When selling gold to the shopkeepers, it is stipulated, if he sells it for cash, gold or silver, that the exchange must take place immediately, so that he gives them the gold and takes the price for it on the spot.
The gold is a trust given to the agent, and he is not liable for it unless he mishandles it or is negligent. This agent may sell whatever he can of the gold, and return the rest to you.
It says in Kashshaaf al-Qinaa‘ (3/484): The agent is a trustee and is not liable for anything that is damaged when in his care, whether the damage is to the money he collects or the goods, and so on, so long as there is no negligence or mishandling on his part, because he is the representative of the owner, as it is under his control and he has the right to dispose of it. So if it is damaged when it is in his care, it is the same as if it is damaged when it is in the possession of the owner, like something that is left with someone for safekeeping, whether that is in return for a fee or not. End quote.
In al-Mawsoo‘ah al-Fiqhiyyah (45/86) it says: The fuqaha’ are unanimously agreed that the agent is a trustee of the wealth that the one who entrusted it to him left in his care, so it is like something that has been left with someone for safekeeping. Based on that, the agent is not liable for anything of it that gets damaged, unless he mishandled it or was negligent.
It makes no difference whether he was working in return for a fee or voluntarily, because the agent is the representative of the one who appointed him to act on his behalf – that is, the owner – in looking after the goods and having the authority to dispose of them, so if they are damaged when in his care it is the same as if they are damaged when they are in the care of the owner – the one who appointed the agent – and because appointing someone as an agent is done for the purpose of assisting and helping, and making the agent liable will take that agreement out of the framework of assisting and helping. End quote.
And Allah knows best.