The fix is in Settings, then Locations. Open the product's Inventory tab and check the breakdown by location, not just the total number at the top. Move the stock to a location enabled for online orders, or enable that location for online sales, and the badge clears without touching a line of theme code.