If you cannot connect from Mac to its own address, then it’s something on the Mac side (or the IP is wrong).
Once you get that sorted out, if connecting from an iPhone doesn’t work, you can try hosting a web server on Mac and seeing if you can connect from that from Mac but not an iPhone browser. If you can, then it’s something on iPhone side, otherwise it’s something with the game.