I think the following topic explains the issue:
wc-cart is null in custom rest api
Hello,
I ran into the same issue.
Working code when using woocommerce version 3.5.7.
After updating woocommerce to version 3.6.2 (including database update). Note that other plugins were not updated.
The debug log shows:
PHP Fatal error: Uncaught Error: Call to a member function add_to_cart() on null
The original call is:
$item_key = WC()->cart->add_to_cart($product_id, $quantity, null, null, $cart_item_data);
Looks like the update is not backwards compatible or introduced a bug.
Thanks for your help/tips!