Cannot connect to Wifi when esim is turned on
My iPhone 13 used to work perfectly. However, recently I added an esim and the phone started to disconnect from the wifi very frequently. When I go to wifi settings, it takes a very long time for wifi to show up in the list. Sometimes when I click on the wifi, it says that the wifi cannot be connected. Just now I tried turning off the esim, and all of a sudden the wifi started to work fine. I have tried restarting the phone and resetting network settings, but the problem persists. How can I solve the wifi issue while keeping my esim? Just for information, my phone was bought in the UK and the esim was bought in France from Free Mobile.
Any help would be greatly appreciated!
iPhone 13, iOS 17