OK a couple of things here:
A Corn snake will NOT starve to death in 3 weeks unless it was already in terrible shape when you bought it. In my 12+ years of keeping corns, I've had snakes go off their feed for as many as three months, and it has almost no noticeable impact. They have to underfeed a long time for it to show.
What you didn't put in your post are the environmental conditions you put the snake into except that, as you said, "the tank was set up correctly." Unfortunately, the perfect set up for temperature and humidity might be ruined if you used orchid bark or cedar chips as a substrate. Both of those can kill young corns. A heatrock can kill a corn snake. If you put in a piece of wood sealed with certain kinds of lacquers it can kill a young corn.
Assuming that the tank was set up perfectly and everything was non-hazardous, there are a few other things to consider. About 5 years ago I had a very bad year where nearly half my hatchling population died out of the blue. The only thing that was different from the previous year was that I had moved a couple miles down the street, but ended up in a different water district. I had necropsies performed on the dead hatchlings, and it was determined that the cause of death was kidney failure due to excessive mineral buildup. Basically the water in the new neighborhood was hard enough to kill snall snakes, and I had to switch to giving them bottled water until I moved again.
It is also possible that the snake was infected with a parasite, like worms or mites. Since it never ate for you, you probably didn't have a chance to take the snake and a stool sample to the vet for a health check. When buying a new snake (or a new dog or cat for that matter) from a person you don't explicitly trust, _always_ take it to a vet for a checkup.
Most pet stores would not give you a refund for this type of thing. If they are reputable, they may offer to replace the snake with another one.