Costco gained a cult following by breaking every rule of retail
No, costco does well because warehouse clubs target B2B markets as well as consumers. I used to work at a warehouse club, and generally people would come in to stock food banks, buy for restaurants, supply their  vending machine routes and halfway houses, and more.Thats why all the giant size packages. They lock in the small business market or nonprofits, because its far easier to buy in bulk there than navigate a grocery store.