It sounds strange to me, too. It appears, though, the judge who ruled the original sentence didn’t comply with federal law about the minimum 5 year sentence. Then, an appeals court judge threw that sentence out, and imposed the longer prison term. It’s still unclear to me.
Wouldn’t this fall under double jeopardy or something?