Is the original owner entitled to their property back while I am entitled to recover the sum paid for it from party A, or does the item somehow become rightfully mine, or... how does this all work?
Expanding on Greendrake's answer, in the UK and many other countries, the basic rule is that you cannot transfer ownership, if you don't have that right in the first place.
There are some few kinds of things where this rule may not hold, depending on what was stolen and how, where/how sold, and which country. Intangible assets like stocks or rights, could be an exception in some places. Land, and rights in land,could be an exception in others. Most sales that took place in a venue that was a traditional public marketplace used to be an odd but true exception in the UK from memory. But that's the basic rule for most common things.
If A steals from someone (V), A doesn't become an owner in law. Just a keeper. A may well be in possession of your diamond ring, but they aren't the owner of it. The original person V is still the owner. That's why lost property is returned not kept. It belongs with the owner.
When you "buy" the ring off A, A has cheated you. A has implied that A was the owner, and as owner, gives you ownership in return for money. But as A was never the owner, A never actually gave you ownership. You were fooled.
What you now have is mere possession of the ring, not ownership. That's all. You are no more its owner than if you found it lying in the street, because A never in fact transferred ownership to you, because they didn't have it themself. V is still its owner, that hasn't changed. As owner, V is entitled to tell you, you must give them the ring back. In fact if you don't, you may be legally committing a crime - keeping someone else's property once you know it is stolen goods. So you have nothing - no ring, no money.
What you do have, is a right to go back to A, and say "You deceived me about that ring. You represented that you had the right to sell it, but you didn't. Give me my money back". And to sue them if they don't. But that requires finding A, being able and willing to sue A, and if you win, being able to get your winnings off A somehow.
Update: Note that if you bought the ring using a credit card, PayPal, finance plan, or something else that guarantees the validity of the purchase or acted as a financer for the purchase, they may have a legal duty to repay you, as well, and they are probably easier to get money back from, than A. So that's realistically your better route to a refund. As above, * they * now need to get their money back from A. That's their problem and they could have more chance of success than you do.
This can work in a chain.
It also doesn't change things, if someone knew, or is an innocent victim.
If A stole it, fenced it to B, who advertised it and sold it to C, who gave it in good faith as a gift to D, then all those transanctions are null and void.
A could never give ownership to B. Therefore B never being owner, could never give ownership to C, and C never being an owner could never give ownership to D.
So the ring still goes back to V. D has nothing. C was an innocent victim but still has nothing unless they can claim off B. And so on.