Apple screen/file sharing issue My parents are getting on in age and live 100 miles from me so I try to fix their mac issues by logging in remotely use Apple Sharing - screen sharing and file sharing, so I turn it on and leave it on on their iMac. However, after a period of time this fails even though nothing is changed. I get the dialog "There was a problem connecting to the server "iMac".

When I got one of my parents to tell me what was the setting said, it said that anyone can access using the IP address (or VNC or SMB) but gave a local network address, not a full internet address. It seems that its only set for LAN network connections? Any idea how this is fixed?
VNC style screen sharing is not really designed for use over the internet. The protocols are slow and require lots of bandwidth, plus dynamic ip allocation from ISPs can break it if you're not using a ddns service.

For this purpose you are much better of using some software other than the built in stuff. There are good commercial ones for $$, but also free options that do the job just as well.

I personally use NoMachine, which works across macOS, Windows, Linux and has mobile apps.

I have also previously used TeamViewer with good success.

For your use case, both of these options will be free, should be fairly reliable and will have more functionality than you probably need.