I too have experienced loss of internet connectivity even though both wifi and cell data are connected and are available. I also experienced this with iOS 17 including latest betas. I have noticed that on iOS 18 Beta releases that the loss of internet seems to be triggered when I enable VPN and then disable VPN. If I enable VPN again, internet data does partially return however some apps don’t show access to internet still.
Nothing fixes this other than a power off/on. Resetting network settings , airplane mode on/off doesn’t resolve the issue.
This was not an issue using iOS 16. Problems started with iOS 17 and are still there in iOS 18.