China warned British Prime Minister Boris Johnson that his decision to ban Huawei from the 5G network would cost Britain dearly in investment.