Extra details. Same symptoms, as of 2023-07-01, on an iPhone 14 with iOS 16.5.x -- working just fine, then at what feels like random, all apps and services start reporting it can't connect to the Internet. ( Browsers won't browse, Apple's Mail says the accounts need attention, phone can't check to see if it needs an update, iMessages don't deliver, purchase notifications don't appear, etc. )
Apple's forums seem to blame the Internet, ISP, router, or WAP, everything but the phone {which I doubt it is the hardware since most of the time it works} or the iOS release {which I suspect is the issue}.
However during times of WiFi failure, all other devices, including older iPhones, iPads, and computers work just fine. The very infrastructure being blamed is working for all other Apple (and non-Apple) devices; the problem is localized to the phone (or more specifically later phones running the latest iOS, as a iPhone XS Max running the same iOS version works just fine).
Taking the "Microsoft" solution of turning off the device and back on does correct the problem (temporarily until it happens again), except this is Apple, and their community knows that should not be necessary with their hardware (and I suspect they believe Apple knows about the issue and is dodging admitting something is wrong for the time being, based on passed patterns).
WHAT DOESN'T WORK: Turning the WiFi off and back on, changing to any other WiFi network, or going into Air Plane mode and back out does not correct the problem.
All the while, the phone does show a successful WiFi connection icon with the Wireless Access Point; the settings screen also confirms this (though the 'No Internet' text in red sometimes is present and sometimes not -- either way, Apps can't reach the Internet). You can switch and authenticate to other WiFi networks, too, but all report No Internet when connected.
EXTRA INFO: Using UniFi, it's possible to see what the Wireless Access Point sees. And while the Phone connects to the Access point (even though it's not servicing the Internet), the Wireless Access Point does see the phone (as you'd expect). The phone successfully gets an IP address via DHCP; using several test networks with static IP addresses, the correct IP is assigned after the WiFi Connection happens ...but the phone's applications and setting screen report there's No Internet Connection over that link.
The Wireless Access Point is servicing other devices as well, so the WAP has Internet connectivity, despite where Apple would like to point the finger.
Additionally, I've put a Firewalla box in between as a monitor, as well as a pfSense firewall downstream of that. They each see the iPhone's DHCP connection request and claim that small, rare bursts, very far apart (many minutes later), of intermediate trickles of traffic (in the very low kilobytes) are making it onto the network from the iPhone and are being delivered back to the phone. I suspect we're the DHCP negotiations, and then nothing from the phone.
And just since someone's going to ask, no VPN is in use.
EMPIRICAL EVIDENCE: We notice the problem seems to happen the most when the phone shifts into using 5G and then returning to WiFi.
e.g., go to lunch, come back, phone acts as if the Internet is no longer there -- power cycle required.
Devices that only handle 4G have no problems handing off between WiFi and 4G as familiar WiFi networks reappear.
COMMUNITY QUESTION: Does anyone else notice anything about the events around when 'No Internet Connection' problems surface, such as our 5G woes?