The official reason?
Riaboshapka was too slow in bringing results.
The actual reason?
TL;DR: It's a short-term gamble to mollify competing interests that threaten to remove him from office.
Zelenskiy's polling numbers (as well as those of his Prime Minister and Parliamentary Speaker) have dropped lately due to their work on the Steinmeier Formula (basically half-annexing a city in Ukraine to Russia due to a high percentage of Russian allegiance in that town) and the issue with Trump's impeachment. He's being forced to walk a very narrow tightrope (more on that later) between his bold anti-corruption campaign promises and not angering several oligarchs who hold the purse strings, including Donald Trump.
Another one is Ihor Kolomoiskiy, the Ukrainian billionaire who owned the network Zelenskiy's show was on and bankrolled Zelenskiy's presidential run, and Kolomoiskiy has begun to cash in his chips for favors from the president. Specifically, favors regarding PrivatBank.
The Ukrainian government seized and nationalized the bank in 2016 because it had like $6 billion missing from its ledger which threatened to collapse Ukraine's fragile economic market. One of the two owners of that bank? Ihor Kolomoiskiy. Kolomoiskiy claims that the bank's seizure was unlawful and it should be returned to him. Meanwhile, the IMF is threatening to not lend to Ukraine anymore if PrivatBank is returned to Kolomoiskiy because it seems like a return to a corrupt Ukraine.
So back to Zelenskiy's tightrope. He is firing several senior members of his government as a stopgap to look like he's fighting corruption, while also helping to avoid a clash between Kolomoiskiy and anti-corruption staffers so as to avoid losing his funding to continue.