Uniform Commercial Code § 2-403(2)-(3), enacted in every U.S. jurisdiction, provides that:
(2) Any entrusting of possession of goods to a merchant who deals in
goods of that kind gives him power to transfer all rights of the
entruster to a buyer in ordinary course of business.
(3) "Entrusting" includes any delivery and any acquiescence in
retention of possession regardless of any condition expressed between
the parties to the delivery or acquiescence and regardless of whether
the procurement of the entrusting or the possessor's disposition of
the goods have been such as to be larcenous under the criminal law.
So, if the store sold the merchandise you left in the store in the original question, the subsequent buyer of the goods would have good title to the goods as a bona fide purchaser for value.
Therefore, you would have to resort to some other remedy than regaining possession of the originally purchased merchandise from the store, such as receiving a replacement items or a refund of the purchase price (possibly with an adjustment for change in the item's market value between the time it was purchased and the time you received a substitute item). See generally, Uniform Commercial Code Article 2, §§ 711, 713 and 715.
Arguably, since the sale is complete, you avail yourself not of UCC remedies after the store has conveyed good title to a third-party, but of a tort lawsuit for conversion, in which case the issue is, as noted in the other answer by @DaleM, whether there was abandonment of the goods (which seems unlikely in most cases contemplated by the question).
If the goods were not abandoned than your remedy would be to sue the store for the fair market value of the items sold to a third-party (although normally, the purchase price would be a conclusive proof of this value in a short time frame from a consumer good).
How does this scenario differ from leaving personal items at the store
that I purchased elsewhere?
Somewhat. A store cannot convey good title to a third-party in personal items of a type that it does not sell. So you could bring an action for replevin to recover the personal item you left behind from a third-party to whom the merchant sold it, for example, if you left behind at pocket watch with a car dealer (leaving the buyer of the pocket watch with a claim against the car dealer for an implied in law breach of warranty of title in connection with a sale of goods), but not if you left behind a pocket watch at a pawn shop.