Because cycling a tank is growing a large population of bacteria, it can be affected by many things and sometimes takes the full 6-8 weeks, if not supplied with enough substrate.
How much seasoned media, substrate and rockwork was added?
How long had it seasoned? a few weeks? months are better.
I always have buckets of substrate sitting in sumps waiting to ad to new tanks (sometimes seasoning for years), and lots of rocks and biofilm lined pieces to start the tank. And I do mean buckets (not a small amount like a few handfuls) or a couple drinking glasses of sand.
If enough biofilm lined surfaces weren't added, and immediately given sufficient food (in the form of ammonia) your cycle may have stalled, and the bacterial population reduced itself, then when you add fish after the die off, couldn't keep up.
Just a theory.