After searching everywhere I found there is a way to add eSIM in iPhone using the following API
func addPlan(with: CTCellularPlanProvisioningRequest, completion
This API is only available for carriers. You need a special entitlement from Apple to be able to call it in your application, otherwise you will get the error you mentioned.
Just to clarify something about eSIMs; there are several ways to add eSIM to the device:
CTCellularPlanProvisioning.addPlan(with: )
API that you referred to you in your question