Please check customer_group
table in Magento2 database.
Check NOT LOGGED IN value in customer_group_code
field. If it's not available in that field, that means when the customer Sign Out then Magento2 can't get the customer group for NOT LOGGED IN
group.
Add NOT LOGGED IN
group in the database, Execute this in SQL,
INSERT INTO `customer_group` (`customer_group_id`, `customer_group_code`, `tax_class_id`) VALUES ('0', 'NOT LOGGED IN', '3');
And if 'NOT LOGGED IN' value available in that field then set itscustomer_group_id
'0'.
UPDATE `customer_group` SET customer_group_id = 0 WHERE customer_group_code='NOT LOGGED IN';
This work for me properly.