In my opinion, there are 2 possible reasons for this announcement:
1. Prigozhin's last try to blackmail the Russian military to get better equipment.
His forces were the only ones advancing since last summer. The capture of Soledar and 80% of Bakhmut are the only advances worth mentioning on the russian side (we ignore the losses here), so he can be cocky about it. If he feels he has leverage with Putin, because his Wagners are the only competent force Russia has, he can behave as he did in the last couple of weeks, insult and ridicule the highest Russian militairs without consequences. If they begin to fear his withdrawal, they will give him what he wants by his logic.
2. Putin ordered Wagner's role in Ukraine to be reduced.
Maybe Putin doesn't like the way Wagner operates, maybe he fears their growing strength and influence. Maybe he wants the Bakhmut battle to be finished by Russian military rather then by illegal mercenaries to be able to sell it to his people. Maybe he needs them gone, if he ever wants to start talking with the west again. Maybe he remembered, that mercenary organizations are still illegal in Russia (lol). That he dismissed some higher militairs because of their connection to Wagner and Wagner's starvation of ammo and equipment supports that theory.
In this case, Prigozhin decided to blame Gerassimow and Shoigu rather than Putin of course, because Putin is the only one he truly fears.
--
In any case, this is pretty big. If Prigozhin officially announces to withdraw from Bakhmut, then I don't see how he will change his mind easily. Also I don't think the Russian military will start to supply him with everything he asks for. Then they would open themselves to further blackmail.