A mini-cart is not cleared after an order is placed or a customer is logged out

Seems like magento 2 bug with cart count after customer logout.

Is there any solution?

It is a bug, I see it all the time.
I recommend report it in the official issue tracker: https://github.com/magento/magento2/issues

How to clear the mini-cart on an order placement?