Did you want to pass an instance of MainWin?
Yes! I guess?

So just gather the value and set it as a context property before loading main.qml?
Going to mod my code and load main.qml (and additionally MainWin.qml inside main.qml), and then use the gpsio function to get and set the values. I am already exposing the necessary variables from main.qml to C++, so the gpsio function can update them as needed.

Which is not jsut very uncommon (creating a C++ -> QML dependency instead of just the other way around), it is also more complicated.
...and 100% necessary. In the end, there will be a gpsio function that continuously updates the QML UI with new values.

The only thing that it is not so easy is to get the equivalent of the return value.
But you don't seem to either return something from the function nor do you try to use the returned value. Quite puzzling why you even retrieve it.
The return value is not necessary. It is left over from me just trying to get everything to work....and copy/pasting code from online examples. The return value can and will be deleted.