I had a variation of this problem.
At times my PC would show as connected, but my apps like Sheets would tell me there was no internet connection.
I would try to connect to my hotspot, but my PC would only occasionally see my iPhone.
I tried all the solutions presented here (among others) to no avail.
The steps that ended up working for me were:
Open ‘Network and Internet’ settings.
Open ‘Connect, manage known networks’
Open ‘Show available networks’
Open ‘Manage known networks’
Click on my network (as I said above, the PC says I am connected but I really do not have internet access)
At this point the properties page for that network should open.
Click the ‘Edit’ button next to the ‘Advanced Wi-Fi network properties’ entry.
In the pop-up window that appears, check ‘Look for other wireless networks while connected to this network’.
At this point I went back to view available networks and my iPhone was in the list.
i hope this helps someone. This issue, for me, was bizarrely random and always incredibly annoying.
Here is one thing that ended up working for me