That is wrong, according to the case law. Facts here are very different bc TJ product is backed by the TJ guarantee; therefore, although identical TJ product when PJ sells it, it is "materially different" because PJ doesn't back the TJ product. That material change is a trademark violation, especially where PJ is advertising they buy/resell TJ product (impossible and confusing to customers).
Simply look up the case law when first sale doctrine does not apply as a result of material changes to the product because the change in warranty/customer service inherently tied to the product/brand.
Here is a decent article [1]published by the American Bar Association regarding the resale of "genuine" goods (not counterfeit) by unauthorized retailers. Skip to the "warranty policy and unauthorized dealer page" section, then "going to court".
Note the exceptions to first sale doctrine include "material changes" to the trademark good, including non physical changes, then does a decent job of listing those changes recorgnized by the courts.
[1] https://www.americanbar.org/publications/blt/2014/07/01_payn...
Edit: from article regarding non-physical changes to trademark product, "Perhaps most commonly, differences in warranty protection coverage between authorized and unauthorized sales often lead to trademark infringement"
Do not confuse issues around distributorships, which are contracts that say, I will agree to sell you these goods at wholesale prices so long as you agree not to sell them anywhere I say you can't.
Your example with reselling prescription opiates, is that opiates are a controlled substance, food is not.
Trademark would only be a problem here if what Pirate Joes was selling was counterfeit Trader Joe's goods.
Pirate Joes' core business was perfectly legal in the US. The only way trademark could be a problem is that Pirate Joes might be ruled too close to Trader Joes, and that's the trademark of the business, not the trademark of the items for sale in the store.