I don't think it is right or ethical for an agent to buy their own listing, infact it's downright wrong.
In Victoria, an agent can buy his own listing provided he informs the Vendor in writing that he is buying it.
This also applies to any other of his associated parties (relatives and other work colleagues) - the agent must inform the Vendor.
As for right or wrong in this case we are discussing, I don't know....
From a vendor's viewpoint, if there is not a lot of interest in the property, and the agent puts up their hand and makes an offer the Vendor is happy with and accepts, then I can't see anything wrong with that. The Vendor can say no at any time.
From the agent's viewpoint, to see an opportunity to buy a property cheaply creates a conflict of professional interest - I would like to buy every property I buy well under market and sell it the same day for a nice profit, and as an investor, so would the agent.
But, he has a professional duty to try and achieve the best possible sale price for his Vendor, so in this case, he is negligent if he buys it cheap and sells it the same day for much more.
He could argue that he didn't know the buyer he sold it to before he bought it from his Vendor, but I'd seriously doubt that this was the case. It's way too convenient that he could buy it and miraculously have a buyer appear the same day.
If I was a judge and it came before me in a court, I would need to know that he knew his buyer beforehand, and also that he had informed his Vendor that he was buying the property.
If this could be proved, then I would rule that he was negligent, because he is contracted to the Vendor to act in his best interests and on his behalf.
10 years in the slammer and no time off.
First offense.