To use Find My and Location Services on an iPhone effectively, both your iPhone and the device you're trying to locate must have an active internet connection. These services rely on internet access to share your location with friends and family and to track the locations of devices, people, and items. Without internet connectivity on either end, the sharing and locating features of Find My and Location Services will not function properly.
If you connect to Wifi, doesn't necessarily mean you are connected to the internet. --> Internet not available WiFi and Cellular … - Apple Community