That's not true. In the brief four months between being published and the author being revealed as a pseudonym it sold a respectable number of copies (8,500 across all formats - that doesn't sound like a lot, but it was at the time only published in the UK, and for a hardback book that is actually a large amount). By publishing industry standards it was commercially successful.
JK Rowling herself has said the number of copies the book sold in its first three months corresponds fairly well to the number of books she sold under her own name when she was initially published.
Yeah but that is most probably more due to her already existing contacts and thus she started a completely different place than others have to.
Luck does play quite a large part in this once the initial vetting for quality is done.
JK Rowling wrote a crime novel under a different name. The critics praised it, but it was a commerical failure. It's more likely that luck can play a large failure.