england-and-wales
Person 'A' entered the property in good faith and took goods that they thought they had permission to take. Under the circumstances, neither would appear to be a crime and certainly neither would be prosecuted since A could simply offer that as their defence and be relatively certain of a jury acquittal.
As regards the property itself, A has a legal obligation to return it to Person C, the rightful owner. Failing to do so would be a crime, per the Theft Act (1968).
Where a person gets property by another’s mistake, and is under an
obligation to make restoration (in whole or in part) of the property
or its proceeds or of the value thereof, then to the extent of that
obligation the property or proceeds shall be regarded (as against him)
as belonging to the person entitled to restoration, and an intention
not to make restoration shall be regarded accordingly as an intention
to deprive that person of the property or proceeds.
Even if you paid money for property that turned out to be stolen, your beef isn't with the rightful owner, it's with Person B, who tricked you into paying for those goods falsely.
If no money changed hands, then probably the police would decline to investigate entirely since 'A' and 'C' have only been slightly inconvenienced by the whole affair.