You're doing something wrong.I've also used iTunes, and I lost the eSIM on my iPhone 13 Pro as well. So I haven't noticed any difference between the two programs in that regard.
Restore your iPhone, iPad or iPod to factory settings using a computer – Apple Support (AU)
A factory restore erases the information and settings on your iPhone, iPad or iPod and installs the latest version of iOS, iPadOS or iPod software.
* Restoring an iPhone won’t delete your eSIM.
Is literally at the bottom of that page.