iPhones will display this error if you are adding a plan and the phone has no connection to the internet.   To add an eSIM the SIM profile must be downloaded from a server and so the phone needs to be online for this part.