Say A, B, C account. A sells gold and get dollars from account B to account A. And now they can buy oil from owner of account C.
But who owns and runs these accounts or the transactions between them? One option is SWIFT system. Which Russia got excluded in some capacity from. As such it is clear that system cannot be trusted. Value of dollars there are very unlikely to be good for long term. And same applies to any accounts in banks in western influence sphere.
Thus directly transacting is better option in long run. For any country that wants to keep their economy stable.