Hi there, Hige229.
It appears that you're having a problem with your iPhone. When you switch from mobile data to Wi-Fi, you're unable to connect with the internet. You have to reset the network settings of your iPhone in order to connect via Wi-Fi. We know how important it is that your iPhone connects with the internet, and we're glad to help with this.
Recommended settings for Wi-Fi routers and access points - Apple Support -- If this only happens with your home's Wi-Fi network, make sure the router is using these recommended settings. If you don't manage your network, ask the one who does or ask your ISP to help.
If this happens with all Wi-Fi networks or the previous steps didn't apply/help, continue below:
First, go to Settings > Safari and see if there are any Content Blockers in use. If there are, turn it/them off and test.
Install or remove configuration profiles on iPhone - Apple Support -- Go to Settings > General and see if "Profile" is listed. If you're not seeing "Profile", that means there hasn't been one installed on your phone. If there is, contact whoever requested that it be installed or installed it before removing the profile.
Learn the meaning of the iPhone status icons - Apple Support -- If you're using any VPN or security applications, delete them and reset your network settings to remove it's/their affect. See if you're able to connect with the internet again.
Let us know how that goes.
Take care.