This error usually shows up if you have a network-locked device. You need a network-unlocked device to download and support eSIMs.
To check this:
Go to Settings > General > About > Carrier Lock
If you see ‘No SIM restrictions’ then your phone is network unlocked.
Reach out to your carrier to get your device network unlocked if you don’t see this message.