magento2 – truck summary returns 0

Would you suggest the possible reason for the cart summary to show & # 39; 0 & # 39 ;?

Please see the screenshot:

https://prnt.sc/od4sy7

This happens after an ajax call that executes two functions below:

Protected function _updateShoppingCart ()
{
$ this -> _ objectManager -> get ( Psr  Log  LoggerInterface :: class) -> addInfo ("_ updateShoppingCart");
$ objectManager =  Magento  Framework  App  ObjectManager :: getInstance ();
$ customerSession = $ objectManager-> get (& # 39; Magento  Customer  Model  Session & # 39;);
$ postcode = $ this-> getRequest () -> getParam (& # 39; postcode & # 39;);
$ customerSession-> setPostcode (($ postcode == null? "": $ postcode));

try {
$ cartData = $ this-> getRequest () -> getParam (& # 39; cart & # 39;);

$ this -> _ checkoutSession-> setMyValue ($ cartData);

if (is_array ($ cartData)) {
$ filter = new  Zend_Filter_LocalizedToNormalized (
                ['locale' => $this->_objectManager->get(
                    MagentoFrameworkLocaleResolverInterface::class
                )->getLocale()]
            );

foreach ($ cartData as $ index => $ data) {
yes (isset ($ data['qty'])) {
$ cartData[$index]['qty']    = $ filter-> filter (trim ($ data['qty']));
}
}
if (! $ this-> cart-> getCustomerSession () -> getCustomerId () && $ this-> cart-> getQuote () -> getCustomerId ()) {
$ this-> cart-> getQuote () -> setCustomerId (null);
}

$ cartData = $ this-> cart-> suggestItemsQty ($ cartData);
$ this-> cart-> updateItems ($ cartData) -> save ();
$ this -> _ checkoutSession-> setMyValue ($ cartData);

}
} catch ( Magento  Framework  Exception  LocalizedException $ e) {
$ this-> messageManager-> addException ($ e, __ (& # 39; We can not update the shopping cart & # 39;));
$ this-> messageManager-> addError (
$ this -> _ objectManager-> get ( Magento  Framework  Escaper :: class) -> escapeHtml ($ e-> getMessage ())
);

} capture ( Exception $ e) {
$ this-> messageManager-> addException ($ e, __ (& # 39; We can not update the shopping cart & # 39;));
$ this -> _ objectManager-> get ( Psr  Log  LoggerInterface :: class) -> critical ($ e-> getMessage (). "------ 2");

}
}
Protected function _getTotalsHtml ()
{

$ resf = $ this-> resultFactory-> create (ResultFactory :: TYPE_PAGE);
$ layout = $ resf-> addHandle (& # 39; checkout_cart_index & # 39;) -> getLayout ();
$ answer['cartcontent'] = $ this -> _ view-> getLayout () -> getBlock (& ​​# 39; checkout.cart.form & # 39;) -> toHtml ();
$ answer['checkout_method'] = $ this -> _ view-> getLayout () -> getBlock (& ​​# 39; checkout.cart.methods.bottom & # 39;) -> toHtml ();
$ answer['page_messages'] = $ this -> _ view-> getLayout () -> getBlock (& ​​# 39; checkout.cart.validationmessages & # 39;) -> toHtml ();
$ answer['content'] = $ layout-> renderNonCachedElement (& # 39; checkout.cart.empty & # 39;);
$ cartQuote = $ this-> cart-> getQuote () -> setTotalsCollectedFlag (false) -> collectTotals () -> save ();
$ answer['subtotaldata'] = $ this -> _ objectManager-> create (& # 39; Magento  Checkout  Model  DefaultConfigProvider & # 39;) -> getConfig ();
$ resultJson = $ this-> resultFactory-> create (ResultFactory :: TYPE_JSON);
$ resultJson-> setData ($ response);
$ this -> _ checkoutSession-> getQuote () -> collectTotals () -> save ();

returns $ resultJson;
}

The large totals become & # 39; 0 & # 39 ;, once in 2 times.