Go into the wifi settings and change the IP setting to manual, put the same IP address and subnet back in but leave the router IP blank.

This should result in the iPhone staying connected to wifi but using cellular data for internet.

I logged in specifically to thank you for this. Although I had to put in 127.0.0.1 instead of 0.0.0.0 for the IP