Every environment is different and obviously I'm not privvy to the details of yours, but generally speaking, there might be situations where network addresses might differ when accessing systems from different locations. Also, because many Onestream systems are composed of different servers, depending on where that code is actually running (extender vs custom calc etc) might potentially also give you different results.
Last but not least, and not necessarily linked to the original problem but in general terms, "for google" - it's a remote http call, which is relatively slow and expensive. For something executed repeatedly, it might make sense to have something that avoids making that call - it would probably make the solution slightly less dynamic but faster and less risky (what if Ipify.org goes down?).