How to use mobile data instead on wifi (while wifi is on) on Android Phone?
You are trying to connect to a local network from a public network.. 

Using WiFi allows the local connection as you've mentioned but using Internet is different because it is not a device on the same WiFi network ( local )

To connect to a public ip, the device should have a server... Try looking into making a simple http server for either the PC or Phone.